This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author allan
Recipients allan
Date 2011-01-05.12:51:32
SpamBayes Score 4.442915e-10
Marked as misclassified No
Message-id <1294231894.7.0.0581440878919.issue10835@psf.upfronthosting.co.za>
In-reply-to
Content
when sys.executable is run with a modified argv[0] such as:

> sh -c "exec -a '' /usr/bin/python2.7 -c 'import sys; print(sys.executable)'"

it returns some a hardcoded value.   In this case, it returns /usr/bin/python.   This value is likely wrong when python is installed with "make altinstall".

A possible solution is to modify the "progname" variable in Python/pythonrun.c to include the version in it so that the hardcoded return value is the most version specific binary.  I.e.

static char *progname = "python2.7";
History
Date User Action Args
2011-01-05 12:51:34allansetrecipients: + allan
2011-01-05 12:51:34allansetmessageid: <1294231894.7.0.0581440878919.issue10835@psf.upfronthosting.co.za>
2011-01-05 12:51:33allanlinkissue10835 messages
2011-01-05 12:51:33allancreate