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 483556 - AssertionError: pygtk.require() must be called before importing gtk
AssertionError: pygtk.require() must be called before importing gtk
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: glchess
unspecified
Other All
: High critical
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
: 484800 486339 487059 490652 492879 496342 497679 498273 498275 498790 504325 510383 510837 512137 546042 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-10-05 01:56 UTC by sean.hendershot
Modified: 2008-08-14 07:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Re-adds the pygtk.require() call (471 bytes, patch)
2008-03-10 03:46 UTC, Robert Ancell
committed Details | Review

Description sean.hendershot 2007-10-05 01:56:00 UTC
Version: 2.20.0.1

What were you doing when the application crashed?
Opening it.


Distribution: Debian lenny/sid
Gnome Release: 2.20.0 2007-09-21 (Debian)
BugBuddy Version: 2.20.0

System: Linux 2.6.21-1-686 #1 SMP Sat May 26 16:14:59 UTC 2007 i686
X Vendor: The X.Org Foundation
X Vendor Release: 70101000
Selinux: No
Accessibility: Disabled
GTK+ Theme: Clearlooks
Icon Theme: gnome

Memory status: size: 0 vsize: 0 resident: 0 share: 0 rss: 0 rss_rlim: 0
CPU usage: start_time: 0 rtime: 0 utime: 0 stime: 0 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 0



----------- .xsession-errors ---------------------
Traceback (most recent call last):
  • File "/usr/games/glchess", line 20 in ?
    start_game()
  • File "/var/lib/python-support/python2.4/glchess/glchess.py", line 2 in start_game
    import main
  • File "/var/lib/python-support/python2.4/glchess/main.py", line 18 in ?
    import gtkui
  • File "/var/lib/python-support/python2.4/glchess/gtkui/__init__.py", line 1 in ?
    from gtkui import GtkUI
  • File "/var/lib/python-support/python2.4/glchess/gtkui/gtkui.py", line 18 in ?
    pygtk.require('2.0')
  • File "/usr/lib/python2.4/site-packages/pygtk.py", line 61 in require
    assert not sys.modules.has_key('gtk'), \
AssertionError: pygtk.require() must be called before importing gtk
--------------------------------------------------
Traceback (most recent call last):
  • File "/usr/games/glchess", line 20 in ?
    start_game()
  • File "/var/lib/python-support/python2.4/glchess/glchess.py", line 2 in start_game
    import main
  • File "/var/lib/python-support/python2.4/glchess/main.py", line 18 in ?
    import gtkui
  • File "/var/lib/python-support/python2.4/glchess/gtkui/__init__.py", line 1 in ?
    from gtkui import GtkUI
  • File "/var/lib/python-support/python2.4/glchess/gtkui/gtkui.py", line 18 in ?
    pygtk.require('2.0')
  • File "/usr/lib/python2.4/site-packages/pygtk.py", line 61 in require
    assert not sys.modules.has_key('gtk'), \
AssertionError: pygtk.require() must be called before importing gtk

Comment 1 Robert Ancell 2007-10-10 01:20:25 UTC
*** Bug 484800 has been marked as a duplicate of this bug. ***
Comment 2 Robert Ancell 2007-10-10 01:47:59 UTC
Also reported on sf.net 2007-09-13 05:22 :

When I try to test glchess the suggested way I get the following
exception.

itz@unicorn:~/glchess-1.0.6$ PYTHONPATH=lib/ ./glchess
*** Using development data files ***
Traceback (most recent call last):
  • File "./glchess", line 4 in ?
    import glchess.main
  • File "/home/itz/glchess-1.0.6/lib/glchess/main.py", line 18 in ?
    import gtkui
  • File "/home/itz/glchess-1.0.6/lib/glchess/gtkui/__init__.py", line 1 in ?
    from gtkui import GtkUI
  • File "/home/itz/glchess-1.0.6/lib/glchess/gtkui/gtkui.py", line 18 in ?
    pygtk.require('2.0')
  • File "/var/lib/python-support/python2.4/pygtk.py", line 69 in require
    assert not sys.modules.has_key('gtk'), \
AssertionError: pygtk.require() must be called before importing gtk

This is on Debian etch, python 2.4, python-gtk2 2.8.6.

Ian nobrowser AT gmailSPAN.SPAMcom
Comment 3 Christoph Wolk 2007-10-14 02:25:05 UTC
*** Bug 486339 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Andersen 2007-10-16 09:02:45 UTC
*** Bug 487059 has been marked as a duplicate of this bug. ***
Comment 5 Robert Ancell 2007-10-22 12:06:10 UTC
I've moved pygtk.require() into the main glchess (src/glchess.in) file so it really is getting called first. Since this issue is not happening for me in Ubuntu Gutsy I'll need someone else to confirm. The change is committed to the gnome-games-2.2.0 branch.
Comment 6 Christoph Wolk 2007-10-27 19:35:32 UTC
*** Bug 490652 has been marked as a duplicate of this bug. ***
Comment 7 Christoph Wolk 2007-11-03 01:46:58 UTC
*** Bug 492879 has been marked as a duplicate of this bug. ***
Comment 8 palfrey 2007-11-16 15:58:04 UTC
*** Bug 496342 has been marked as a duplicate of this bug. ***
Comment 9 Robert Ancell 2007-11-19 04:52:23 UTC
*** Bug 497679 has been marked as a duplicate of this bug. ***
Comment 10 Thomas Andersen 2007-11-19 19:03:42 UTC
*** Bug 498273 has been marked as a duplicate of this bug. ***
Comment 11 Thomas Andersen 2007-11-19 19:03:46 UTC
*** Bug 498275 has been marked as a duplicate of this bug. ***
Comment 12 Thomas Andersen 2007-11-21 17:00:54 UTC
*** Bug 498790 has been marked as a duplicate of this bug. ***
Comment 13 Robert Ancell 2007-12-20 07:23:31 UTC
*** Bug 504325 has been marked as a duplicate of this bug. ***
Comment 14 Thomas Andersen 2008-01-18 21:00:43 UTC
*** Bug 510383 has been marked as a duplicate of this bug. ***
Comment 15 Robert Ancell 2008-01-26 00:57:41 UTC
*** Bug 512137 has been marked as a duplicate of this bug. ***
Comment 16 Robert Ancell 2008-01-26 00:57:47 UTC
*** Bug 510837 has been marked as a duplicate of this bug. ***
Comment 17 Thomas D Ahle 2008-02-10 14:38:48 UTC
Why call pygtk.require at all?
Yes I know about http://faq.pygtk.org/index.py?req=show&file=faq02.004.htp , but for all other libraries used, we seam to rely only on the packagers. And after all, do anybody really use (py)gtk < 2 today?
Comment 18 Robert Ancell 2008-03-10 03:28:22 UTC
This change was accidentally undone:
http://svn.gnome.org/viewvc/gnome-games/trunk/glchess/src/glchess.in?r1=6889&r2=6894&pathrev=7100
Comment 19 Robert Ancell 2008-03-10 03:46:26 UTC
Created attachment 106944 [details] [review]
Re-adds the pygtk.require() call
Comment 20 Robert Ancell 2008-03-10 03:46:59 UTC
Bug 521154 states this call is required on some systems.
Comment 21 Robert Ancell 2008-03-10 12:25:22 UTC
Code freeze break granted and patch committed
http://svn.gnome.org/viewvc/gnome-games?view=revision&revision=7500
Comment 22 Robert Ancell 2008-08-14 07:29:02 UTC
*** Bug 546042 has been marked as a duplicate of this bug. ***