After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694108 - [pygobject 2.x] should not add an interface to a class that has already been initialised
[pygobject 2.x] should not add an interface to a class that has already been ...
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
2.28.x
Other Linux
: High major
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 693812 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-18 17:34 UTC by Marc Deslauriers
Modified: 2013-08-28 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hack: Allow static tests to run (to some degree) without GI (4.89 KB, patch)
2013-02-19 14:42 UTC, Martin Pitt
needs-work Details | Review

Description Marc Deslauriers 2013-02-18 17:34:19 UTC
pygtk applications are getting a warning similar to the following:

/usr/lib/python2.7/dist-packages/gobject/__init__.py:115: Warning: attempting to add an interface (GtkEditable) to class (HistoryFileEntry) after class_init
  type_register(cls, namespace.get('__gtype_name__'))

Because of recent glib changes:
http://blogs.gnome.org/desrt/2012/11/05/a-warning-about-glib/


See downstream bugs:
https://bugs.launchpad.net/ubuntu/+source/pygtk/+bug/1129309
https://bugs.launchpad.net/ubuntu/+source/meld/+bug/1103170
https://bugs.launchpad.net/ubuntu/+source/dia/+bug/1102960
Comment 1 Martin Pitt 2013-02-19 07:06:50 UTC
This makes pygtk totally unusable with current GLib, so bumping.
Comment 2 Martin Pitt 2013-02-19 13:32:48 UTC
*** Bug 693812 has been marked as a duplicate of this bug. ***
Comment 3 Martin Pitt 2013-02-19 13:50:06 UTC
For reference, pygobject 3.x fixed this with

http://git.gnome.org/browse/pygobject/commit/?id=efcb0f9fda65e24

We need a fix with the same spirit in either pygobject 2.x or pygtk (not yet sure which one, I never touched either)
Comment 4 Martin Pitt 2013-02-19 14:33:52 UTC
I think this is in pygobject after all (the 2-28 branch)
Comment 5 Martin Pitt 2013-02-19 14:42:56 UTC
Created attachment 236766 [details] [review]
hack: Allow static tests to run (to some degree) without GI

As pygobject 2.28's introspection support and test is broken beyond repair with current glib and g-i, this is a hack to make the test suite at least work somewhat with --disable-introspection. This reproduces the bug, and allows me to verify the fix.
Comment 6 Martin Pitt 2013-02-19 14:49:02 UTC
Comment on attachment 236766 [details] [review]
hack: Allow static tests to run (to some degree) without GI

This is OMGfugly, I just want it here for possible future referrence.
Comment 8 Christoph Reiter (lazka) 2013-02-21 18:32:23 UTC
This broke quodlibet/exfalso.

I get:

./exfalso.py
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError
RuntimeError

and half of the widgets aren't showing. Any ideas?
Comment 9 Christoph Reiter (lazka) 2013-02-21 18:54:13 UTC
Problem seems to be with overriding signals and super. The following doesn't work anymore since the commit above:

class ScrolledWindow(gtk.ScrolledWindow):
    __gsignals__ = {'size-allocate': 'override'}

    def do_size_allocate(self, alloc):
        return super(ScrolledWindow, self).do_size_allocate(self, alloc)
Comment 10 F Wolff 2013-08-28 13:59:26 UTC
I also reported a (seemingly) similar problem in bug 705662, although my minimal example to reproduce the issue looks a bit different. Same effect though (existing pygtk application not working any more).