Skip to content

Fix build failure with SWIG 4.5 and Python 3.13 - #50

Merged
jreidinger merged 1 commit into
yast:masterfrom
DimStar77:master
Aug 28, 2026
Merged

Fix build failure with SWIG 4.5 and Python 3.13#50
jreidinger merged 1 commit into
yast:masterfrom
DimStar77:master

Conversation

@DimStar77

Copy link
Copy Markdown
Contributor
  • Include "compat.h" in ytypes.i to define missing Python 2 compatibility macros (e.g., PyInt_Check, PyString_Check) which were removed in SWIG 4.5.
  • Replace the internal and removed _PyUnicode_AsString with PyUnicode_AsUTF8 for standard Python 3 Unicode conversion.

Problem

Package fails to build against SWIG 4.5

Solution

Code fix

Testing

Tested locally to osc build againt Staging:D (which currently tracks swig 4.5)

- Include "compat.h" in ytypes.i to define missing Python 2 compatibility
  macros (e.g., PyInt_Check, PyString_Check) which were removed in SWIG 4.5.
- Replace the internal and removed _PyUnicode_AsString with PyUnicode_AsUTF8
  for standard Python 3 Unicode conversion.
@DimStar77

Copy link
Copy Markdown
Contributor Author

hacked-up direct checkin to Staging:D to validate build:
https://build.opensuse.org/package/show/openSUSE:Factory:Staging:D/yast2-python-bindings

@jreidinger
jreidinger merged commit f5cb545 into yast:master Aug 28, 2026
1 check failed
@github-actions

Copy link
Copy Markdown

✅ Autosubmission job #33153309206 successfully finished
✅ Created submit request #1374267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants