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.

classification
Title: pyw should search for pythonw to implement #!/usr/bin/env python
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eryksun, paul.moore, python-dev, steve.dower, tim.golden, vinay.sajip, zach.ware
Priority: normal Keywords:

Created on 2015-10-10 03:21 by eryksun, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg252681 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2015-10-10 03:21
The Windows launcher searches PATH to implement the shebang "#!/usr/bin/env". Given "#!/usr/bin/env python", it always searches for L"python" (see issue 17903), even in pyw.exe. maybe_handle_shebang in PC/launcher.c should instead use a macro that's conditionally defined as L"pythonw" when building pyw.exe and L"python" when building py.exe. This parallels the existing PYTHON_EXECUTABLE macro.
msg257032 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-12-26 13:11
New changeset 2af2367d7eda by Vinay Sajip in branch '3.5':
Fixes #25360: Search for pythonw.exe when in pyw.exe.
https://hg.python.org/cpython/rev/2af2367d7eda

New changeset ba1e102c3320 by Vinay Sajip in branch 'default':
Closes #25360: Merged fix from 3.5.
https://hg.python.org/cpython/rev/ba1e102c3320
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69547
2015-12-26 13:11:52python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg257032

resolution: fixed
stage: resolved
2015-10-10 03:23:04eryksunsetnosy: + vinay.sajip
2015-10-10 03:21:46eryksuncreate