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 575426 - (somewhat) hardcoded python paths break for Python 2.6
(somewhat) hardcoded python paths break for Python 2.6
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-03-15 14:23 UTC by Sascha Silbe
Modified: 2009-04-22 10:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sascha Silbe 2009-03-15 14:23:16 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
Comment 1 Sascha Silbe 2009-04-22 08:21:55 UTC
Bug filing process set wrong component for this bug as well. Fixing. 
Comment 2 Frederic Peters 2009-04-22 10:45:10 UTC
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.