Opened 9 years ago

Closed 9 years ago

#5790 defect closed fixed (fixed)

threads_init not always present in gi bindings

Reported by: Itamar Turner-Trauring Owned by: Itamar Turner-Trauring
Priority: normal Milestone:
Component: core Keywords:
Cc: jesstess Branch:
Author: itamarst


Jessica reported the following:

$ python -c "import twisted; print twisted.__version__; from twisted.internet import gtk3reactor"
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "twisted/internet/", line 22, in <module>
     from twisted.internet import gireactor
   File "twisted/internet/", line 53, in <module>
   File "twisted/internet/", line 42, in _oldGiInit
   File "/usr/lib/python2.7/dist-packages/gi/", line 268, in __getattr__
     return getattr(self._introspection_module, name)
   File "/usr/lib/python2.7/dist-packages/gi/", line 101, in __getattr__
     self.__name__, name))
 AttributeError: 'gi.repository.GLib' object has no attribute 'threads_init'

Change History (6)

comment:1 Changed 9 years ago by Itamar Turner-Trauring

Cc: jesstess added

What OS was this? What version of pygobject?

comment:2 Changed 9 years ago by jesstess

This is Ubuntu Natty:

$ apt-cache show python-gobject | grep Version
Version: 2.28.3-1ubuntu1
Version: 2.28.3-1ubuntu1.1
$ uname -a
Linux kid-charlemagne 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:33:45 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/issue
Ubuntu 11.04 \n \l

comment:3 Changed 9 years ago by Itamar Turner-Trauring

AFAICT it just doesn't exist in that version. hasattr() time!

comment:4 Changed 9 years ago by itamarst

Author: itamarst
Branch: branches/old-gi-5790

(In [35156]) Branching to 'old-gi-5790'

comment:5 Changed 9 years ago by Itamar Turner-Trauring

Branch: branches/old-gi-5790

I will do this as part of #5676, since otherwise the fixes will conflict.

comment:6 Changed 9 years ago by itamarst

Resolution: fixed
Status: newclosed

(In [35285]) Merge pygtkcompat-5676: Better support for newer and older gi versions.

Author: itamar Review: jesstess Fixes: #5676, #5790

Work with old versions of gi that didn't wrap enable_threads(), and with newer versions that have the gi.pygtkcompat compatability layer.

Note: See TracTickets for help on using tickets.