GNOME Bugzilla – Bug 694108
[pygobject 2.x] should not add an interface to a class that has already been initialised
Last modified: 2013-08-28 13:59:26 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
This makes pygtk totally unusable with current GLib, so bumping.
*** Bug 693812 has been marked as a duplicate of this bug. ***
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)
I think this is in pygobject after all (the 2-28 branch)
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 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.
Fixed in http://git.gnome.org/browse/pygobject/commit/?h=pygobject-2-28&id=9456ba70fdb98b3a4eb7ee2f630182387a54ca00
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?
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)
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).