[Python-ideas] Make py.exe default to Python 3

Chris Angelico rosuav at gmail.com
Wed Mar 9 00:39:00 EST 2016


On Wed, Mar 9, 2016 at 4:32 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> If the proposal is to change the default behaviour for:
>
> * launching the interactive interpreter
> * running scripts without a shebang line
> * running scripts with an unrecognised shebang line
>
> then I think it's reasonable to switch all those to default to the
> newest CPython runtime on the machine, regardless of whether that's
> Python 2 or Python 3.
>
> However, if the proposal is also to change the handling of the
> following shebang lines:
>
> * #!/usr/bin/python
> * #!/usr/local/bin/python
> * #!/usr/bin/env python
> * #!python
>
> then I think those should continue to be handled in a manner
> consistent with PEP 394 (and as PEP 397 currently specifies): as
> referring to Python 2 (unless PY_PYTHON explicitly says otherwise or
> only Python 3 is available).

Agree with both of these points. AIUI the original proposal was solely
about the first half, with no recommendation of change to the second.

What does py.exe do with a "#!/usr/bin/python" if the only Python
installed is 3.5? Does it run it under 3.5, or error out?

ChrisA


More information about the Python-ideas mailing list