python-cffi broken

Bug #1311051 reported by Elan Ruusamäe
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PLD Linux

Bug Description

seems python-cffi is very broken, __pycache__ is imho python3 specific way of storing .pyc/.pyo

version: python-cffi-0.8.2-1.x86_64

$ winswitch_applet

** (process:19871): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:19871): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:19871): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
[II] 2014/22/04 13:52:10.954517 applet.<module>() python version 2.7.6 (default, Feb 21 2014, 20:00:27) \n[GCC 4.8.2 20140221 (release)]
[II] 2014/22/04 13:52:10.954636 applet.<module>() gtk version (2, 24, 22), pygtk version (2, 24, 0)
[DD] 2014/22/04 13:52:10.969388 main_loop.loop_init(True)
Traceback (most recent call last):
  File "/usr/bin/winswitch_applet", line 5, in <module>
  File "/usr/share/python2.7/site-packages/winswitch/client/", line 17, in main
  File "/usr/share/python2.7/site-packages/winswitch/client/", line 32, in <module>
  File "/usr/share/python2.7/site-packages/winswitch/util/", line 38, in loop_init
  File "/usr/lib64/python2.7/site-packages/twisted/internet/", line 23, in <module>
    from twisted.internet import _glibbase
  File "/usr/lib64/python2.7/site-packages/twisted/internet/", line 20, in <module>
    from twisted.internet import base, posixbase, selectreactor
  File "/usr/lib64/python2.7/site-packages/twisted/internet/", line 24, in <module>
    from twisted.internet import error, udp, tcp
  File "/usr/lib64/python2.7/site-packages/twisted/internet/", line 29, in <module>
    from twisted.internet._newtls import (
  File "/usr/lib64/python2.7/site-packages/twisted/internet/", line 21, in <module>
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
  File "/usr/lib64/python2.7/site-packages/twisted/protocols/", line 40, in <module>
    from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
  File "/usr/share/python2.7/site-packages/OpenSSL/", line 8, in <module>
  File "/usr/share/python2.7/site-packages/OpenSSL/", line 11, in <module>
  File "/usr/share/python2.7/site-packages/OpenSSL/", line 4, in <module>
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/bindings/openssl/", line 83, in __init__
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/bindings/openssl/", line 99, in _ensure_ffi_initialized
  File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/bindings/", line 72, in build_ffi
  File "/usr/lib64/python2.7/site-packages/cffi/", line 341, in verify
  File "/usr/lib64/python2.7/site-packages/cffi/", line 73, in load_library
  File "/usr/lib64/python2.7/site-packages/cffi/", line 125, in _write_source
IOError: [Errno 2] No such file or directory: '/usr/lib64/python2.7/site-packages/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.c'

Revision history for this message
Jacek Konieczny (jajcus-jajcus) wrote :

`__pycache__` usage is not limited to Python3 `*.py` files. That directory is used by 'compiled' code of python modules, but is a good place for other similar artifacts. It seems like a great choice for files 'compiled' by cffi – this way multiple Python interpreter versions can use python modules from the same directory. And the system 'site-packages' is not the only place where python modules may be stored.

The problem here is, that there are no cffi-compiled files included for the 'cryptography.hazmat.bindings' module and cffi tries to compile them on runtime. It is good it failed – so we can see the packaging problem.

The 'compiled' extension modules should be included in the 'cryptography.hazmat.bindings' and, maybe, the 'cryptography.hazmat.bindings' should be modified not to try to recompile that.

Here are some hints:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers