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 eryksun
Recipients Alexandros Karypidis, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-12-12.23:19:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576192775.44.0.00929237557609.issue38999@roundup.psfhosted.org>
In-reply-to
Content
> I think supporting the shebang line in py.exe is a misfeature and 
> would prefer we'd never done it (though it predates my involvement). 

Do you mean all shebangs, including those with a native file path?
Or do you mean just virtual shebangs, and in particular those that search PATH via "/usr/bin/env"? It's not without controversy even in Unix. For example, see [1] and the rebuttal to it in the comments.

In the case of this issue, "env" is used to run a script in an active virtual environment. This doesn't rely on the user or system PATH, assuming the command can be found in the active scripts directory.

As an alternative to modifying the launcher, pip (via distlib) could be updated to transform "#!/usr/bin/env pythonX[.Y]" shebangs into "#!/usr/bin/env python" when installing scripts in Windows. pip and distlib are third-party tools, however, so that suggestion is beyond the scope of this issue tracker.

[1] https://jmmv.dev/2016/09/env-considered-harmful.html
History
Date User Action Args
2019-12-12 23:19:35eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, Alexandros Karypidis
2019-12-12 23:19:35eryksunsetmessageid: <1576192775.44.0.00929237557609.issue38999@roundup.psfhosted.org>
2019-12-12 23:19:35eryksunlinkissue38999 messages
2019-12-12 23:19:34eryksuncreate