[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum
Guido van Rossum added the comment: I guess this explains it: >>> for p in os.getenv("PATH").split(os.pathsep): print(p) ... C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem C:\WINDOWS\System32\WindowsPowerShell\v1.0\ C:\WINDOWS\System32\OpenSSH\ C:\Program Files\Git\cmd C:\Program Fil

[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum
Guido van Rossum added the comment: Oops, I think I understand why. The py launcher actually does a search for an interpreter named "python" and that turns out to be python 3.10. Now my question becomes why py chooses a different default than that. I don't have a py.ini file in either of th

[issue42430] Windows py launcher default for shebang line is surprising

2020-11-21 Thread Guido van Rossum
New submission from Guido van Rossum : I have 3.9 and 3.10 installed on my Windows box. The py launcher runs Python 3.10 when invoked on a script starting with a shebang line #!/usr/bin/env python even though the default without a script is 3.9, as shown here: PS C:\Users\gvanrossum\peps> p