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 vinay.sajip
Recipients gwideman, mhammond, vinay.sajip
Date 2013-10-02.21:57:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380751047.78.0.91199157067.issue19141@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-10-02 21:57:27vinay.sajipsetrecipients: + vinay.sajip, mhammond, gwideman
2013-10-02 21:57:27vinay.sajipsetmessageid: <1380751047.78.0.91199157067.issue19141@psf.upfronthosting.co.za>
2013-10-02 21:57:27vinay.sajiplinkissue19141 messages
2013-10-02 21:57:27vinay.sajipcreate