-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Install source and version
- Installed from the Windows Store
- Installed with the MSIX from python.org
- Installed with the MSI from python.org
- Installed with
winget install 9NQ7512CXL7T
Version:
25.0
Describe the bug
Using this minimal script for testing, named t.pyw
:
#! /usr/bin/env pythonw
import sys
import time
from ctypes import windll
windll.user32.MessageBoxW(None, "Script started", "Hi", 0x10)
print('This goes to stdout', file=sys.stdout)
time.sleep(3)
print('This goes to stderr', file=sys.stderr)
time.sleep(3)
windll.user32.MessageBoxW(None, "Script finished", "Done", 0x10)
If launched using double click it does not do anything. If launched using py t.pyw
, the error message [ERROR] No runtime installed that matches w. Try running "py install w".
is produced. For some reason the shebang is not processed properly, and in fact the shebang #! /usr/bin/env pyw
works perfectly, don't know why.
To Reproduce
Steps to reproduce the behavior:
- Open a command prompt.
- Run
py t.pyw
- See error
Expected behavior
A normal run, just like when the #! /usr/bin/env pyw
is used, or like the #! /usr/bin/env python3
shebang with the legacy installer. The real script which triggered this for me was working perfectly with the legacy installer/launcher and the #! /usr/bin/env python3
shebang.