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 paul.moore
Recipients paul.moore, sfx2k, steve.dower, tim.golden, zach.ware
Date 2018-08-08.14:40:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533739236.82.0.56676864532.issue34359@psf.upfronthosting.co.za>
In-reply-to
Content
From https://docs.python.org/3.7/using/windows.html#shebang-lines the supported shebang lines are

* /usr/bin/env python
* /usr/bin/python
* /usr/local/bin/python
* python

There's a provision in there:

"""
The /usr/bin/env form of shebang line has one further special property. Before looking for installed Python interpreters, this form will search the executable PATH for a Python executable. This corresponds to the behaviour of the Unix env program, which performs a PATH search.
"""

The launcher does *not* implement the full functionality of the Unix "env" program, and in particular doesn't support (relative or absolute) paths in the Python interpreter part.

While "search PATH for the relative path given in the env shebang line" would be a potential feature request, it's not current behaviour, and in my view, it's too rare of a scenario to be worth the complexity it would add to the launcher.

As a workaround, you can use an absolute path in your shebang line:

#!F:\python\scripts3\.venv\Scripts\python.exe

(Obviously that requires a little more manual management of the shebang lines in your scripts).
History
Date User Action Args
2018-08-08 14:40:36paul.mooresetrecipients: + paul.moore, tim.golden, zach.ware, steve.dower, sfx2k
2018-08-08 14:40:36paul.mooresetmessageid: <1533739236.82.0.56676864532.issue34359@psf.upfronthosting.co.za>
2018-08-08 14:40:36paul.moorelinkissue34359 messages
2018-08-08 14:40:36paul.moorecreate