[Bug 4133] New: gtk (from python-pygtk) can't be imported from Python
bugzilla-daemon at treke.net
bugzilla-daemon at treke.net
Sat Mar 29 16:43:19 UTC 2008
http://bugs.openembedded.net/show_bug.cgi?id=4133
Summary: gtk (from python-pygtk) can't be imported from Python
Product: Openembedded
Version: Angstrom 2008.x
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Build
AssignedTo: openembedded-issues at lists.openembedded.org
ReportedBy: bz-oe at kdzbn.homelinux.net
Created an attachment (id=8941)
--> (http://bugs.openembedded.net/attachment.cgi?id=8941)
Patch to change init() back to _init in pygtk's gtk/__init__.py
The following program:
import pygtk
pygtk.require("2.0")
import gtk
fails at the last line with a fairly long pause (which is normal), then:
Traceback (most recent call last):
File "test.py", line 3, in <module>
File "/usr/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", line 82, in
<module>
init()
NameError: name 'init' is not defined
Looking at /usr/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py, I see that
there's an _init() function defined, but the code on line 82 is trying to call
init() instead. The code appears to come from a patch added to OE in rev
903edcf621d6b2974f60aceef8e79c2816561136 ("add
prevent_to_get_display_during_import.patch"). That patch moves an _init() call
into an "if not hasattr(sys.modules['__main__'], 'python_launcher_enabled'):"
block.
But the patch also changes _init() into init(), which doesn't exist.
A patch to current OE is attached, to change the function called by the patch
back to _init().
--
Configure bugmail: http://bugs.openembedded.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Openembedded-issues
mailing list