GNOME Bugzilla – Bug 660659
It's impossible to import ComboBoxText from python
Last modified: 2018-08-17 13:39:03 UTC
Created attachment 197987 [details] [review] Patch to include gtk/gtk-2.24-types.defs in gtk/gtk-2.24.defs When I try to import gtk.ComboBoxText, I get a traceback telling me that python can not import name ComboBoxText. I downloaded the source and tryed to find the origin of this traceback. The name ComboBoxText is present in gtk-2.24-types.defs but I discovered this file was not included in gtk-2.24.defs (like gtk-2.20-types.defs is in gtk-2.20.defs). So I added the include, compiled pygtk and the symbol ComboBoxText was present in gtk.c and _gtk.so. I attach the patch to fix this issue.
I ran into the same issue on Python 2.7.2/pygtk 2.24.0 on Windows 7. The following code: ------------------------ import pygtk import gtk testCombo = gtk.combo_box_text_new_with_entry() ------------------------ Caused this segfault error: ------------------------ TypeError: Cannot create a consistent method resolution order (MRO) for bases GInterface, CellLayout, CellEditable ** ERROR:gobject/pygobject.c:963:pygobject_new_full: assertion failed: (tp != NULL) This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ------------------------ Recompiling pygtk with Anaël's patch took care of the problem.
I confirm this error with Python 2.7.3 / pygtk 2.24.2. I get exactly the same error message as Joe.
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!