[New-bugs-announce] [issue39785] usr/bin/python doesn't use default python (3) on Windows

fireattack report at bugs.python.org
Fri Feb 28 13:15:33 EST 2020

New submission from fireattack <human.peng at gmail.com>:


1. Install both Py2 and 3. 
2. Make sure Py3 is the default.
3. (Optional) Make sure only Python3 is in path, not Python2.

Run the following script from CMD:


import platform

What expected:


What happened: 


According to https://docs.python.org/3/using/windows.html#shebang-lines, `#!/usr/bin/python` should use the default python. My environment is set to default to py3, and I don't even have python2 in my PATH. 

C:\Users\ikena\Desktop>py --version
Python 3.8.1

C:\Users\ikena\Desktop>python --version
Python 3.8.1

C:\Users\ikena\Desktop>where python

components: Windows
messages: 362892
nosy: fireattack, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: usr/bin/python doesn't use default python (3) on Windows
versions: Python 3.8

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list