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 <rep...@bugs.python.org>
<http://bugs.python.org/issue28686>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to