RPM

Comment 1 for bug 633649

Revision history for this message
In , Dave (dave-redhat-bugs) wrote :

Description of problem:
Python 2.7 deprecated the PyCObject API in favor of a new "capsule" API.
  http://docs.python.org/dev/whatsnew/2.7.html#capsules

The deprecations are set to "ignore" by default, so in theory the API still works.

However the deprecation has caused at least one app to fail (virt-manager, see bug 620216, due to it modifying the warning settings), so I've been doublechecking the scope of usage of the PyCObject API, and am filing bugs against components that are possibly affected.

You can trigger a hard failure of the API via:
>>> import warnings
>>> warnings.filterwarnings('error')
and then try to use the module (sorry; I don't have a more specific reproducer for this package yet)

I'm not yet sure what the best approach is to fixing this.

Version-Release number of selected component (if applicable):
rpm-4.8.1-4.fc14.src.rpm

Grepping prepped source tree shows these uses:
./rpm-4.8.1/python/header-py.c:371: } else if (PyCObject_Check(obj)) {
./rpm-4.8.1/python/header-py.c:372: h = PyCObject_AsVoidPtr(obj);
./rpm-4.8.1/python/spec-py.c:37: PyObject *ptr = PyCObject_FromVoidPtr(h, NULL);
./rpm-4.8.1/ChangeLog:753: Permit header object generation from PyCObjects
./rpm-4.8.1/ChangeLog:24215: OTOH we need to call PyCObject_FromVoidPtr() with non-const cast..