This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 623855 - Python binding uses PyCObject API (deprecated in Python 2.7)
Python binding uses PyCObject API (deprecated in Python 2.7)
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
14
All Linux
low Severity medium
: ---
: ---
Assigned To: Libvirt Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks: PyCObject
  Show dependency treegraph
 
Reported: 2010-08-12 20:59 EDT by Dave Malcolm
Modified: 2011-12-06 22:49 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 22:49:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Dave Malcolm 2010-08-12 20:59:34 EDT
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 your module.

Grepping for PyCObject shows usage of the API in many places:
./libvirt-0.8.2/python/typewrappers.c:109:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virDomainPtr",
./libvirt-0.8.2/python/typewrappers.c:124:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virNetworkPtr",
./libvirt-0.8.2/python/typewrappers.c:139:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virInterfacePtr",
./libvirt-0.8.2/python/typewrappers.c:154:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virStoragePoolPtr",
./libvirt-0.8.2/python/typewrappers.c:169:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virStorageVolPtr",
./libvirt-0.8.2/python/typewrappers.c:184:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virConnectPtr",
./libvirt-0.8.2/python/typewrappers.c:199:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virNodeDevicePtr",
./libvirt-0.8.2/python/typewrappers.c:213:    ret = PyCObject_FromVoidPtrAndDesc(node, (char *) "virSecretPtr", NULL);
./libvirt-0.8.2/python/typewrappers.c:226:    ret = PyCObject_FromVoidPtrAndDesc(node, (char *) "virNWFilterPtr", NULL);
./libvirt-0.8.2/python/typewrappers.c:239:    ret = PyCObject_FromVoidPtrAndDesc(node, (char *) "virStreamPtr", NULL);
./libvirt-0.8.2/python/typewrappers.c:253:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virDomainSnapshotPtr",
./libvirt-0.8.2/python/typewrappers.c:269:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virEventHandleCallback",
./libvirt-0.8.2/python/typewrappers.c:285:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virEventTimeoutCallback",
./libvirt-0.8.2/python/typewrappers.c:300:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "virFreeCallback",
./libvirt-0.8.2/python/typewrappers.c:315:        PyCObject_FromVoidPtrAndDesc((void *) node, (char *) "void*",

To what extent does this leak through to users of the API.

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

Version-Release number of selected component (if applicable):
libvirt-0.8.2-3.fc14.src.rpm
Comment 1 Fedora Admin XMLRPC Client 2011-09-22 13:57:09 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Fedora Admin XMLRPC Client 2011-09-22 14:00:30 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Fedora Admin XMLRPC Client 2011-11-30 14:56:46 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 4 Fedora Admin XMLRPC Client 2011-11-30 14:58:09 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Fedora Admin XMLRPC Client 2011-11-30 15:02:52 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Fedora Admin XMLRPC Client 2011-11-30 15:03:43 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 Eric Blake 2011-12-06 22:49:54 EST
Fixed by this, in F15 or newer.  F14 is near end-of-life now, so it's probably not worth backporting now, so I'm just marking this as closed nextrelease.

commit 4254dfea78e72c109c9e78727a5c5146be372654
Author: Cole Robinson <crobinso@redhat.com>
Date:   Thu Dec 2 12:15:10 2010 -0500

    python: Use PyCapsule API if available
    
    On Fedore 14, virt-manager spews a bunch of warnings to the console:
    
    /usr/lib64/python2.7/site-packages/libvirt.py:1781: PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7.  Please use capsule objects instead.the capsule API if available. I've verified this compiles
    fine on older python (2.6 in RHEL6 which doesn't have capsules), and
    virt-manager seems to function fine.

Note You need to log in before you can comment on or make changes to this bug.