[Python-bugs-list] [ python-Bugs-727732 ] getpath.c-generated prefix wrong for Tru64 scripts

SourceForge.net noreply@sourceforge.net
Fri, 25 Apr 2003 12:57:06 -0700


Bugs item #727732, was opened at 2003-04-25 14:57
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727732&group_id=5470

Category: Python Interpreter Core
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Coleman (mkc)
Assigned to: Nobody/Anonymous (nobody)
Summary: getpath.c-generated prefix wrong for Tru64 scripts

Initial Comment:
Under Tru64 (version 5.1a, and probably others), when a
Python script is structured like so:

    #!/something/bin/python
    import sys
    print sys.prefix

the calculation of prefix in getpath.c won't work
correctly.  The reason is that argv[0] will be 'python'
rather than '/something/bin/python' (as it would be
under, say, Linux).

The code happens to work correctly in some simple
scenarios, but fails in a pretty mysterious way if one
has a different python in one's PATH than the one in
the #! line.  So, for example, if my PATH=/usr/bin and
there is a /usr/bin/python, then if I run the script
above, sys.prefix will be set to '/usr' instead of
'/something' and the wrong module path will be set up, etc.

It would be much better to simply obey the compiled
PREFIX instead, at least in the case where argv[0] has
no slashes.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=727732&group_id=5470