[issue28686] py.exe ignored PATH when using python3 shebang

Steve Barnes report at bugs.python.org
Sun May 14 04:36:33 EDT 2017


Steve Barnes added the comment:

If the user is operating in a virtual environment they are ring fenced and, presumably, don't wish any other versions of python to be used, (regardless of the SheBang in the files).

Since we don't AFAIK have any possibility of mixed virtual environments ignoring SheBangs should meet the basic requirements of operating inside of a venv.

How about a simple, but brutal approach, of if VIRTUAL_ENV is set in the current environment then always use the virtual environment python and launch with the -x option (ignore first line). This is the equivalent of using a version specifier as well as having a SheBang. This way the wrong python for the script might be executed but that is the responsibility of the person who set up the venv.

----------
nosy: +Steve Barnes

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28686>
_______________________________________


More information about the Python-bugs-list mailing list