GNOME Bugzilla – Bug 576546
Problems with Python 2.6
Last modified: 2009-04-11 14:25:36 UTC
*** Rebuilding plugin inspection files *** Traceback (most recent call last):
+ Trace 213806
import gst
from _gst import *
q, tail = self.find_head_package(parent, str(name))
q = self.import_it(head, qname, parent)
m = self.loader.load_module(fqname, stuff)
m = self.hooks.load_dynamic(name, filename, file)
return ihooks.Hooks.load_dynamic(self, name, filename, file)
return imp.load_dynamic(name, filename, file)
make[3]: *** [inspect-build.stamp] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 From IRC: <mnauw> thaytan, bilboed-pi: seems like http://bugs.python.org/i ssue4244 <bilboed-pi> mnauw, erf... undocumented and deprecated <mnauw> I could workaround by adding a level=-1 parameter to the import_module functions in /usr/lib/python2.6/ihooks.py (on my installation at <bilboed-pi> mnauw, I guess we should switch to something else :)
Created attachment 131364 [details] [review] proposed fix I reworked the import thingy. I only tried it with python2.5. Please try with 2.6?
Works for me on python 2.6
Gets rid of the ihooks error, of course, but I still can't run gst-python uninstalled: Python 2.6 (r26:66714, Feb 26 2009, 17:32:42) [GCC 4.4.0 20090219 (Red Hat 4.4.0-0.21)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gst i>>> import gst.pbutils Traceback (most recent call last):
+ Trace 213895
>>> What info would help you?
The last issue (pbutils) is a problem we've been having forever with submodules when running uninstalled (or running it from gst-python's directory). The reason why you can "import gst.interfaces" ... is because gst/__init__.py imports that module (line 195). I'm not 100% sure if that's the right thing to do (that means loading all the submodules, which also means loading all the C .so they expose). The ltihook patch can go in though. Need to think a bit more about the submodule issue.
What about importing those submodules from gst/__init__.py only when gstltihooks is used? Like: if __gstltihooks_used__: import pbutils # and some more
Created attachment 132515 [details] [review] Updated version with suggestion from Phil
commit 1cd54e6d4565308d6a8eb3dd2bb1f214f8f38aca Author: Alessandro Decina <alessandro.decina@collabora.co.uk> Date: Sat Apr 11 16:20:11 2009 +0200 Fix uninstalled usage with python 2.6. Fixes #576546 Also imports submodules as mentionned by Philippe Normand.