GNOME Bugzilla – Bug 705662
Broken class initialisation with multiple inheritance
Last modified: 2018-08-17 13:37:25 UTC
I've been getting some reports recently of problems with my pygtk (GTK 2) program, Virtaal. Some links if interesting: https://bugs.launchpad.net/ubuntu/+source/virtaal/+bug/1100276 https://bugzilla.redhat.com/show_bug.cgi?id=988049 http://bugs.locamotion.org/show_bug.cgi?id=2713 (also reported privately on Arch Linux) I think this reduced snippet shows the same issue: import gtk from gobject import PARAM_READWRITE class UnitView(gtk.EventBox, gtk.CellEditable): __gtype_name__ = "UnitView" __gproperties__ = {'editing-canceled': (bool, '', '', False, PARAM_READWRITE),} uv = UnitView() uv.connect('editing-done', lambda: True) It looks like this commit could be the cause: https://git.gnome.org/browse/pygobject/commit/?h=pygobject-2-28&id=9456ba70fdb98b3a4eb7ee2f630182387a54ca00 which is part of bug 686149. When defining the class, this warning is printed: /usr/lib64/python2.7/site-packages/gobject/__init__.py:115: Warning: attempting to add an interface (GtkCellEditable) to class (UnitView) after class_init type_register(cls, namespace.get('__gtype_name__')) When trying to connect to the 'editing-done' signal, this error is printed: TypeError: <UnitView object at 0x18f4fa0 (UnitView at 0x16ae570)>: unknown signal name: editing-done This still works on my Mageia 2 installation, even though the version of pygobject2 is also 2.28.6. I guess Fedora and Ubuntu picked up the commit from git directly.
For reference, quoting verbatim from https://mail.gnome.org/archives/python-hackers-list/2013-August/msg00001.html: ----------------------------------------------------------------------------------------- This seems to be fallout from the following change in glib: https://bugzilla.gnome.org/show_bug.cgi?id=687659 The PyGObject ticket and commit you mentioned was to ensure PyGObject works after the glib change. However, this fix was for PyGObject 3 or "PyGI" which is the introspection version of the Python bindings. It looks like Virtaal is using PyGTK and the older PyGObject 2 static bindings. I see a back port of the fix for PyGObject 2 here: https://bugzilla.gnome.org/show_bug.cgi?id=694108 https://git.gnome.org/browse/pygobject/commit/?h=pygobject-2-28&id=9456ba70fdb But it is unclear if it is fully resolved based on the comments in the ticket and it doesn't look like there has been a PyGObject 2 release for a few years (the last tag is dated 2011-06-13 release 2.28.6). Apart from testing and releasing a new PyGObject 2 from the pygobject-2-28 branch. A different approach is to update the app to PyGObject 3 and use the compatibility shim (pygtkcompat): https://wiki.gnome.org/PyGObject/IntrospectionPorting -Simon
Also the same on Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=487106 But not sure how to improve current situation :/
This seems to be fixed in my application on recent Linux versions (Mageia and Fedora, at least). I think it might be because of the fix in bug 686149. However, if I'm checking correctly, this is not yet released. I see there are several patches in the Debian package. Is there any chance of a release with these fixes? I happened to test things on PC-BSD recently and saw this again, even though it has been working again on some Linux systems for a while. I guess it is because the Linux distros backported the fix, while the latest official release still doesn't have this. Martin, is my summary correct?
Ubuntu currently provides 12 patches on top of pygobject2. Pushing those, reverting anything else on the 2-28 branch + doing a release sounds like a good idea to me. Any thoughts?
I've tagged a new release (no tarball): https://git.gnome.org/browse/pygobject/commit/?h=pygobject-2-28&id=c9594b6a91e6ca2086fedec2ed8249e0a9c029fc
pygtk is not under active development anymore and had its last code changes in 2013. Its codebase has been archived: https://gitlab.gnome.org/Archive/pygtk/commits/master PyGObject at https://gitlab.gnome.org/GNOME/pygobject is its successor. See https://pygobject.readthedocs.io/en/latest/guide/porting.html for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent version of PyGObject. Thanks!