You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running a script with a shebang, only python versions installed by pymanager will be run. When the shebang specifies a python version installed with a different method, py.exe incorrectly uses the default interpreter version instead. The intended version is available from an existing installation and is shown in pymanage list
To Reproduce
On the system below Python 3.10 has been installed using pymanage, and Python3.12 is an existing installation.
PS C:\Users\clawrence\dev\pymanager> pymanager list
Tag Name Managed By Version Alias
3.10[-64] Python 3.10.11 PythonCore 3.10.11 python[w]3.10.exe, python[w]3.exe
3.14-dev[-64] * Python 3.14.0b1 PythonCore 3.14.0b1 python[w]3-64.exe, python[w]3.14-64.exe, python...
* These runtimes were found, but cannot be updated or uninstalled. *
3.13 Python 3.13 (64-bit) PythonCore 3.13.0
3.13 Python 3.13 (64-bit) PythonCore 3.13.3
3.12 Python 3.12 (64-bit) PythonCore 3.12.7
3.11 Python 3.11 (64-bit) PythonCore 3.11.9
3.10 Python 3.10 (64-bit) PythonCore 3.10.11
3.8 Python 3.8 (64-bit) PythonCore 3.8.10
Some columns were truncated. Use '--format=json' or '--format=jsonl' for full information.
Create two test scripts with a shebang that call the desired python version:
This is currently because we search by alias, and unmanaged installs don't have aliases defined.
We need another fallback search that actually parses the command name and does another search of the installed runtimes. It should restrict to PythonCore, because tags/aliases are actually entirely arbitrary and are not "really" versions, so they can't be treated like that unless we limit the search space to ones we control. But it's probably good enough to detect python(3\.[\d.-abc]+) and convert to PythonCore\$1 for the search.
Describe the bug
When running a script with a shebang, only python versions installed by pymanager will be run. When the shebang specifies a python version installed with a different method, py.exe incorrectly uses the default interpreter version instead. The intended version is available from an existing installation and is shown in
pymanage list
To Reproduce
On the system below Python 3.10 has been installed using pymanage, and Python3.12 is an existing installation.
Create two test scripts with a shebang that call the desired python version:
Calling Python 3.12 (which was not installed by pymanager) runs the default interpreter:
Calling Python 3.10 (installed by pymanager) runs correctly:
py.exe
can run both interpreters correctly when specified as a cli arg:Installing 3.12 using pymanager and the shebang works correctly:
Expected behavior
py.exe
should use the python version specified in the shebang, or return an error it the requested version isn't found.Additional context
The text was updated successfully, but these errors were encountered: