Issue 727732: getpath.c-generated prefix wrong for Tru64 scripts (original) (raw)
Issue727732
Created on 2003-04-25 19:57 by mkc, last changed 2022-04-10 16:08 by admin. This issue is now closed.
Messages (6) | ||
---|---|---|
msg60324 - (view) | Author: Mike Coleman (mkc) | Date: 2003-04-25 19:57 |
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. | ||
msg60325 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2003-05-04 12:43 |
Logged In: YES user_id=21627 Is there any way for a binary to find out its location on disk, on Tru64? | ||
msg60326 - (view) | Author: Mike Coleman (mkc) | Date: 2003-05-07 18:29 |
Logged In: YES user_id=555 I hunted around in the man pages and googled and I couldn't find much. There is a proc ioctl PIOCOPENM (see http://www.advogato.org/person/jum/diary.html?start=34) which will give you an fd to the executable, but I don't know of any way to map that back to a filename. | ||
msg81715 - (view) | Author: Daniel Diniz (ajaksu2) * ![]() |
Date: 2009-02-12 03:20 |
We'd need confirmation, preferably with assistance from a Tru64 guru. | ||
msg81720 - (view) | Author: Mike Coleman (mkc) | Date: 2009-02-12 04:14 |
I'll go down to the cemetery and see if I can dig one up. :-) All of our Tru64 machines have been powered-down for over three years now, so as far as I'm concerned you can mark this one as no longer relevant. | ||
msg81886 - (view) | Author: Daniel Diniz (ajaksu2) * ![]() |
Date: 2009-02-13 06:58 |
Mike, Thanks for the feedback (and laugh!). I'll close this one soon, unless someone requests to keep open. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-10 16:08:20 | admin | set | github: 38368 |
2009-02-20 01:54:08 | ajaksu2 | set | status: pending -> closedresolution: out of datestage: test needed -> resolved |
2009-02-18 01:51:49 | ajaksu2 | set | status: open -> pendingpriority: normal -> low |
2009-02-13 06:58:02 | ajaksu2 | set | messages: + |
2009-02-12 04:14:41 | mkc | set | messages: + |
2009-02-12 03:20:07 | ajaksu2 | set | nosy: + ajaksu2type: behaviormessages: + stage: test needed |
2003-04-25 19:57:06 | mkc | create |