Description
Documentation
In section 4.8.2 of the docs (Shebang Lines), it is stated that: "Any of the above virtual commands can be suffixed with an explicit version (either just the major version, or the major and minor version)."
This sentence refers to the 4 virtual commands: /usr/bin/env, /usr/bin/python, /usr/local/bin/python, python.
This is correct for the last 3 virtual commands (e.g. /usr/bin/python3.12 works), but not for /usr/bin/env.
Specifically, using either the major version (e.g. "/usr/bin/env python3") or the major and minor version (e.g. "/usr/bin/env python3.12") in the shebang line of a .py file, then calling the .py with the windows launcher, results in the following error: "Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases."
Simple solution: change the relevant sentence in the docs to exclude /usr/bin/env: "Any of the above virtual commands (apart from /usr/bin/env
) can be suffixed with an explicit version (either just the major version, or the major and minor version)."
Linked PRs
- gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension #119426
- [3.13] gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426) #119739
- [3.12] gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426) #119741
- [3.12] gh-119070: Avoid test crash due to Unicode in stderr output #119747
- gh-119070: Update test_shebang_executable_extension to always use non-installed version #119846
- [3.13] gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846) #120015
- [3.12] gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846) #120016