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.

Author benspiller
Recipients benspiller, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-05-19.17:20:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The py.exe launcher doc states "If no relevant options are set, the commands python and python2 will use the latest Python 2.x version installed" ... which was indeed working reliably until Microsoft added their weird python.exe shim (which either terminates with no output or brings up the Microsoft Store page) as part of

Now, I find scripts that start with "#!/usr/bin/env python" cause py.exe to run the Windows python.exe shim which confusingly terminates with no output (unless run with no arguments). 

I think to stop lots of developers banging theirs heads against this brick wall, py.exe should include some logic to ignore the C:\Users\XXX\AppData\Local\Microsoft\WindowsApps\python.exe shim, since for someone with py.exe installed, running that is _never_ what you'd want. (or alternatively, work with Microsoft to get this decision reversed, but that may be harder!)

Lots of people are hitting this e.g. ,

Here's the output:

launcher build: 32bit
launcher executable: Console
File 'C:\Users\XXX\AppData\Local\py.ini' non-existent
Using global configuration file 'C:\WINDOWS\py.ini'
Called with command line: apama-build\   -h
maybe_handle_shebang: read 256 bytes
maybe_handle_shebang: BOM not found, using UTF-8
parse_shebang: found command: python
searching PATH for python executable
Python on path: C:\Users\XXX\AppData\Local\Microsoft\WindowsApps\python.exe
located python on PATH: C:\Users\XXX\AppData\Local\Microsoft\WindowsApps\python.exe
run_child: about to run 'C:\Users\XXX\AppData\Local\Microsoft\WindowsApps\python.exe'
child process exit code: 9009

>py -0
Installed Pythons found by py Launcher for Windows
 -3.8-64 *

(nb: was surprising that it didn't run any of those installed versions!)
Date User Action Args
2020-05-19 17:20:47benspillersetrecipients: + benspiller, paul.moore, tim.golden, zach.ware, steve.dower
2020-05-19 17:20:47benspillersetmessageid: <>
2020-05-19 17:20:47benspillerlinkissue40687 messages
2020-05-19 17:20:47benspillercreate