[Python-bugs-list] [Bug #114758] sys.prefix can be wrong with multiple Python installations

noreply@sourceforge.net noreply@sourceforge.net
Mon, 18 Sep 2000 17:19:38 -0700


Bug #114758, was updated on 2000-Sep-18 17:19
Here is a current snapshot of the bug.

Project: Python
Category: Core
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: sys.prefix can be wrong with multiple Python installations

Details: When installations of the same Python version are present on the same machine, sys.prefix (and exec_prefix) can be computed incorrectly for some of them under certain circumstances.  Specifically, if all the following are true:
  * Python A was installed with prefix != exec-prefix
  * Python B's interpreter binary precede's Python A's
    binary in PATH

Then Python A computes sys.prefix wrong: it gets Python B's prefix.

Specific example: I have 2.0cvs installed with
  --prefix=/usr/local/python 
  --exec-prefix=/usr/local/python.linux-i86
with a symlink /usr/local/bin/python2.0cvs pointing to /usr/local/python.linux-i86/bin/python2.0.

I also have the BeOpen Python 2.0b1 RPM installed, so /usr/local/bin/python is the BeOpen build.

Whether I run the CVS version as "/usr/local/bin/python2.0cvs" or as "/usr/local/python.linux-i86/bin/python", it gets sys.prefix wrong:

$ /usr/local/bin/python2.0cvs -c "import sys ; print sys.prefix ; print sys.exec_prefix"
/usr/local/bin/..
/usr/local/bin/../python.linux-i86

$ /usr/local/python.linux-i86/bin/python -c "import sys ; print sys.prefix ; print sys.exec_prefix"       
/usr/local
/usr/local/python.linux-i86

Hmm, it does get exec_prefix right.

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=114758&group_id=5470