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: Windows launcher version lookup flawed
Type: enhancement Stage:
Components: Documentation, Windows Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: LarryZA, docs@python, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2018-07-18 02:09 by LarryZA, last changed 2022-04-11 14:59 by admin.

Messages (4)
msg321855 - (view) Author: LarryZA (LarryZA) Date: 2018-07-18 02:09
In the manual it says that the following .ini file will cause the launcher to run Python3.1 for calls of `py` or `py -3`

[defaults]
python=3
python3=3.1

On my Windows 7 machine I have Python2.7-32, Python3.4-64, and Python3.7-64 (installed in that order).

Setting the ini to:

[defaults]
python=3
python3=3.4

results in `py` running 3.7-64 (expected 3.4-64) and `py -3` running 3.4-64.

Setting both to point to 3.4 in the ini will run 3.4-64 for both commands.
msg321858 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-07-18 05:02
The behavior is correct, so the documentation needs fixing.

Which page has that example on it? Is it assuming that you only have 3.1 installed?
msg321859 - (view) Author: LarryZA (LarryZA) Date: 2018-07-18 05:22
https://docs.python.org/3/using/windows.html

Section 3.4.4.2
msg321861 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2018-07-18 07:07
This line in the docs is incorrect:

    If PY_PYTHON=3 and PY_PYTHON3=3.1, the commands python and python3 
    will both use specifically 3.1

It implies that setting the `python` virtual command to "3" or "2" will use the configured version of the `python3` or `python2` virtual command. As implemented, these three virtual commands are separately configured.

The `python` command is different in one way, since it's also the overall default. If the version set for `python2` or `python3` doesn't match an installed version, that's the end of the search. OTOH, the `python` command will continue to search for any version. For a shebang it prefers "2" over "3", and vice versa for the REPL or a script without a shebang.
History
Date User Action Args
2022-04-11 14:59:03adminsetgithub: 78323
2021-03-27 04:50:19eryksunsettype: behavior -> enhancement
versions: + Python 3.10, - Python 3.7
2019-08-02 22:47:32steve.dowersetversions: + Python 3.8, Python 3.9
2018-07-18 07:07:18eryksunsetnosy: + eryksun
messages: + msg321861
2018-07-18 05:22:46LarryZAsetmessages: + msg321859
2018-07-18 05:02:59steve.dowersetnosy: + docs@python
messages: + msg321858

assignee: docs@python
components: + Documentation
2018-07-18 02:09:35LarryZAcreate