New submission from Allan McRae <al...@archlinux.org>:

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";

----------
components: Interpreter Core
messages: 125420
nosy: allan
priority: normal
severity: normal
status: open
title: sys.executable default and altinstall
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10835>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to