Bug 623859 - pyOpenSSL uses PyCObject API (deprecated in Python 2.7)
Summary: pyOpenSSL uses PyCObject API (deprecated in Python 2.7)
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: pyOpenSSL
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PyCObject
TreeView+ depends on / blocked
 
Reported: 2010-08-13 01:11 UTC by Dave Malcolm
Modified: 2011-06-21 07:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-21 07:24:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2010-08-13 01:11:08 UTC
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')
>>> import OpenSSL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/OpenSSL/__init__.py", line 11, in <module>
    import rand, crypto, SSL, tsafe
PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7.  Please use capsule objects instead.
>>> dir(OpenSSL)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'OpenSSL' is not defined

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


Version-Release number of selected component (if applicable):
pyOpenSSL-0.9-2.fc14.src.rpm

Grepping the source tree shows these uses of the API:
./pyOpenSSL-0.9/src/crypto/crypto.c:807:    c_api_object = PyCObject_FromVoidPtr((void *)crypto_API, NULL);
./pyOpenSSL-0.9/src/crypto/crypto.h:112:    if (PyCObject_Check(crypto_api_object)) { \
./pyOpenSSL-0.9/src/crypto/crypto.h:113:      crypto_API = (void **)PyCObject_AsVoidPtr(crypto_api_object); \
./pyOpenSSL-0.9/src/ssl/ssl.c:121:    ssl_api_object = PyCObject_FromVoidPtr((void *)ssl_API, NULL);
./pyOpenSSL-0.9/src/ssl/ssl.h:73:    if (PyCObject_Check(c_api_object)) { \
./pyOpenSSL-0.9/src/ssl/ssl.h:74:      ssl_API = (void **)PyCObject_AsVoidPtr(c_api_object); \

Some of these are within header files, which could complicate things further.

Comment 1 Fedora Admin XMLRPC Client 2011-06-20 22:34:22 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Tomas Mraz 2011-06-21 07:24:19 UTC
This must be fixed upstream.


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