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 660659 - It's impossible to import ComboBoxText from python
It's impossible to import ComboBoxText from python
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: gtk
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: 2011-10-01 22:34 UTC by Anaël Verrier
Modified: 2018-08-17 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to include gtk/gtk-2.24-types.defs in gtk/gtk-2.24.defs (616 bytes, patch)
2011-10-01 22:34 UTC, Anaël Verrier
none Details | Review

Description Anaël Verrier 2011-10-01 22:34:13 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.
Comment 1 Joe Baker 2012-04-05 03:38:39 UTC
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.
Comment 2 dpitch40 2013-05-10 19:33:53 UTC
I confirm this error with Python 2.7.3 / pygtk 2.24.2. I get exactly the same error message as Joe.
Comment 3 André Klapper 2018-08-17 13:39:03 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!