Closed
Description
Bug report
Given a non-python shebang line, e.g. #!/usr/bin/env bash
, py.exe
falls over with
❯ py ./x.py
Unable to create process using '/usr/bin/env bash ./x.py'
py.exe
should not be trying to interpret non-python shebang lines on Windows. If py
has been invoked (especially if manually invoked rather than implicitly by ftype association), the intent is to interpret the file as a python script.
I originally hit this with rust-lang/rust's x.py script, which is currently using /usr/bin/env bash
to attempt to launch Python 3 across all OSes, whether they provide a python
executable or just python3
. (MSYS makes this more fun, as it does directly interpret and use the shebang line, rather than calling the ftype
registered handler.)
Your environment
❯ winget list python
Name Id Version Available Source
-------------------------------------------------------------------------------------
Python 3 Python.Python.3 3.10.4150.0 3.10.5150.0 winget
Python Launcher {691AAAA1-FE86-4973-8DA2-6AA2B3327562} 3.10.7751.0
Microsoft Windows
Version 21H2 (OS Build 22000.739)