[New-bugs-announce] [issue27064] Make py.exe default to Python 3 when used interactively

Paul Moore report at bugs.python.org
Thu May 19 17:36:05 EDT 2016

New submission from Paul Moore:

By default, the launcher tries to launch (the latest version of) Python 2 on the user's machine. This can be altered with the configuration file, and if the user doesn't have Python 2 installed Python 3 will be used. Now that we are at Python 3.6, it's about time to change that default to try Python 3 first.

This was discussed on python-ideas in the thread starting at https://mail.python.org/pipermail/python-ideas/2016-March/038667.html. My summary of the consensus was at https://mail.python.org/pipermail/python-ideas/2016-March/038759.html

The key points were:

1. For interactive use, make py.exe launch the latest version
installed on the machine, without special-casing a preference for
Python 2.
2. For shebang lines where an unversioned name is used, retain the
current behaviour (for compatibility with Unix).
3. When the user explicitly chooses a version, or has configured the
launcher via the ini file or environment variables, no change to
current behaviour.
4. The change is small enough that it doesn't need a PEP.

The attached patch implements this behaviour.

I assume the patch is to be applied only to Python 3.6, as it is changed behaviour, not a bug fix.

assignee: paul.moore
components: Windows
files: launcher.diff
keywords: needs review, patch
messages: 265898
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Make py.exe default to Python 3 when used interactively
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42906/launcher.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list