Bug 623854
Summary: | Use PyCapsule API instead of deprecated PyCObject API in python bindings | |||
---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dave Malcolm <dmalcolm> | |
Component: | swig | Assignee: | Adam Tkac <atkac> | |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
Severity: | medium | Docs Contact: | ||
Priority: | low | |||
Version: | 14 | CC: | atkac, dwalsh, john.ellson, mgrepl, ovasik | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
URL: | https://sourceforge.net/tracker/?func=detail&aid=3047039&group_id=1645&atid=301645 | |||
Whiteboard: | ||||
Fixed In Version: | swig-2.0.0-5.fc14 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 624674 (view as bug list) | Environment: | ||
Last Closed: | 2010-09-14 05:00:19 UTC | Type: | --- | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 620842, 624674 |
Description
Dave Malcolm
2010-08-13 00:52:58 UTC
Seems like this should be a bug reported to SWIG? (In reply to comment #1) > Seems like this should be a bug reported to SWIG? Right you are. I've just build swig-2.0.0-3.fc15 (https://kojiweb.fedoraproject.org/koji/buildinfo?buildID=190601), can you verify it really fixes the problem, please? I tested libselinux-python built with the new swig only with short script written below and it seems it works fine. $ cat test.py #!/usr/bin/python import warnings; warnings.filterwarnings('error'); import selinux; print "Enabled: %d" % selinux.is_selinux_enabled(); Thanks for looking at this. I'm a little concerned about runtime compatibility between modules built with a version of SWIG that uses one API versus other modules built with a different SWIG using the other API. Looking at swig200-rh623854.patch [1] I see: Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION which looks like there's a fake module named "swig_runtime_data", which exposes "type_pointer". It looks like existing modules built with the old code expect this value to be a PyCObject, whereas new modules built with the new code will expect it to be a PyCapsuleObject. So I'm concerned about lingering bugs which will vary based on when the module was built, and which module gets imported first. Does this work? [1] http://pkgs.fedoraproject.org/gitweb/?p=swig.git;a=blob;f=swig200-rh623854.patch;h=ee53c0262ab7db5fe667c0c979f84b342f0049bb;hb=ca6fe127cf56ca735e30bc66898c6c55b09beba5 (In reply to comment #3) > Thanks for looking at this. I'm a little concerned about runtime compatibility > between modules built with a version of SWIG that uses one API versus other > modules built with a different SWIG using the other API. > > Looking at swig200-rh623854.patch [1] I see: > Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION > which looks like there's a fake module named "swig_runtime_data", which exposes > "type_pointer". > > It looks like existing modules built with the old code expect this value to be > a PyCObject, whereas new modules built with the new code will expect it to be a > PyCapsuleObject. So I'm concerned about lingering bugs which will vary based > on when the module was built, and which module gets imported first. Does this > work? Hm, I didn't remind scenario when multiple modules built with different swigs are simultaneously used. It seems that SWIG_RUNTIME_VERSION must be bumped. However I must discuss this change with upstream first. swig-2.0.0-4.fc14 has been submitted as an update for Fedora 14. http://admin.fedoraproject.org/updates/swig-2.0.0-4.fc14 swig-2.0.0-4.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update swig'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/swig-2.0.0-4.fc14 Bug #627310 might have been caused by this change? (In reply to comment #7) > Bug #627310 might have been caused by this change? Right, bug #627310 should be fixed in swig-2.0.0-5.fc14. swig-2.0.0-5.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update swig'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/swig-2.0.0-5.fc14 swig-2.0.0-5.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report. |