Vinay Sajip added the comment:

The current version of py.exe *does* do a PATH search for a shebang of 
"#!/usr/bin/env python" (see #17903).

The whole *point* of py.exe is to invoke Pythons which are *not* available on 
the PATH.

The behaviour of py.exe is as documented in PEP 397, other than the 
PATH-searching for /usr/bin/env python which is a more recent addition.

People are supposed to put shebang lines in their scripts, else PEP 397 is not 
of much use to them. Scripts installed via setuptools/pip (e.g. into a 
virtualenv) have correct shebang lines prepended to them.

Note that the environment variables and some py.ini settings are *alternative* 
ways of specifying intent. The choosing of 2.x vs. 3.x is also mentioned in the 
PEP and was suggested as the best default for the largest user population - 
that of 2.x users potentially transitioning to 3.x.

Is there some deviation from PEP 397 (other than /usr/bin/env python -> PATH 
search) that you are trying to draw attention to? Or is purely a documentation 
fix sufficient? Otherwise, I will be closing this as wontfix, as the basic 
behaviour was thrashed out when PEP 397 was discussed.

----------
nosy: +mhammond

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

Reply via email to