GNOME Bugzilla – Bug 575426
(somewhat) hardcoded python paths break for Python 2.6
Last modified: 2009-04-22 10:45:10 UTC
Please describe the problem: Jhbuild makes certain assumptions about Python module installation paths that are incorrect for Python 2.6. "site-packages" has been replaced by "dist-packages". For sugar-jhbuild [1], I'm using distutils.sysconfig.get_python_lib(prefix='') to determine the correct path: # We need to add the gtk-2.0 directory explicitly to # the Python path since '.pth' files (here pygtk.pth) # only work properly in system directories pythonpath_basic = distutils.sysconfig.get_python_lib(prefix='').split('/', 1)[1] pythonpath_gtk = os.path.join(self.prefix, ["lib", "lib64"][self.use_lib64], pythonpath_basic, 'gtk-2.0') jhbuild.config.addpath('PYTHONPATH', pythonpath_gtk) # workaround for bug in jhbuild # note: even for use_lib64 we need "lib" here as that's where distutils installs to pythonpath_lib = os.path.join(self.prefix, "lib", pythonpath_basic) jhbuild.config.addpath('PYTHONPATH', pythonpath_lib) os.environ['PYTHON_LIB'] = distutils.sysconfig.get_python_lib(prefix=self.prefix) [1] http://wiki.sugarlabs.org/go/DevelopmentTeam/Jhbuild Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: Original Bug Report [1] filed against sugar-jhbuild [1] http://dev.sugarlabs.org/ticket/494
Bug filing process set wrong component for this bug as well. Fixing.
Thanks for your report, and sorry for the delay, I just commited a fix. commit b8e05a311c3b8b1cedb3a0686cff07bd3998327c Author: Frederic Peters <fpeters@0d.be> Date: Wed Apr 22 12:43:15 2009 +0200 do not hardcode Python modules installation path (#575426) In Python 2.6, site-packages got replaced by dist-packages, so we get the actual value by asking distutils.