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 705662 - Broken class initialisation with multiple inheritance
Broken class initialisation with multiple inheritance
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: general
Git Master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2013-08-08 11:45 UTC by F Wolff
Modified: 2018-08-17 13:37 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8



Description F Wolff 2013-08-08 11:45:17 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.
Comment 1 Reinout van Schouwen 2013-08-10 20:42:47 UTC
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
Comment 2 Pacho Ramos 2014-01-06 16:21:34 UTC
Also the same on Gentoo:
https://bugs.gentoo.org/show_bug.cgi?id=487106

But not sure how to improve current situation :/
Comment 3 F Wolff 2016-03-09 17:32:33 UTC
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?
Comment 4 Christoph Reiter (lazka) 2016-04-14 12:43:49 UTC
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?
Comment 5 Christoph Reiter (lazka) 2017-10-13 10:56:11 UTC
I've tagged a new release (no tarball): https://git.gnome.org/browse/pygobject/commit/?h=pygobject-2-28&id=c9594b6a91e6ca2086fedec2ed8249e0a9c029fc
Comment 6 André Klapper 2018-08-17 13:37:25 UTC
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!