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 zart
Recipients ezio.melotti, vstinner, zart
Date 2013-12-21.14:10:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387635003.7.0.211054481065.issue20042@psf.upfronthosting.co.za>
In-reply-to
Content
Running `py.exe юникод.py` in cmd window fails:

E:\>set PYLAUNCH_DEBUG=1

E:\>py юникод.py
launcher build: 32bit
launcher executable: Console
File 'C:\Users\Zart\AppData\Local\py.ini' non-existent
Using global configuration file 'C:\Windows\py.ini'
Called with command line: .pymaybe_handle_shebang: read 211 bytes
maybe_handle_shebang: BOM not found, using UTF-8
parse_shebang: found command: python3
locating Pythons in 64bit registry
locate_pythons_for_key: unable to open PythonCore key in HKCU
locate_pythons_for_key: "C:\Program Files\Python27\python.exe" is a 64bit executable
locate_pythons_for_key: "C:\Program Files\Python2\PCBuild\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files\Python2\PCBuild\amd64\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files\Python32\python.exe" is a 64bit executable
locate_pythons_for_key: "C:\Program Files\Python3\PCBuild\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files\Python3\PCBuild\amd64\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files\Python33\python.exe" is a 64bit executable
locate_pythons_for_key: "C:\Program Files\Python3\PCBuild\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files\Python3\PCBuild\amd64\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locating Pythons in native registry
locate_pythons_for_key: unable to open PythonCore key in HKCU
locate_pythons_for_key: "C:\Program Files (x86)\Python27\python.exe" is a 32bit executable
locate_pythons_for_key: "C:\Program Files (x86)\Python2\PCBuild\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files (x86)\Python2\PCBuild\amd64\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files (x86)\Python32\python.exe" is a 32bit executable
locate_pythons_for_key: "C:\Program Files (x86)\Python3\PCBuild\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files (x86)\Python3\PCBuild\amd64\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files (x86)\Python33\python.exe" is a 32bit executable
locate_pythons_for_key: "C:\Program Files (x86)\Python3\PCBuild\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
locate_pythons_for_key: "C:\Program Files (x86)\Python3\PCBuild\amd64\python.exe: ?????????????? ?????? ? ????? ?????, ????? ????? ??? ????? ????.
found configured value 'python3=3.2-32' in environment
search for Python version '3.2-32' found '"C:\Program Files (x86)\Python32\python.exe"'
run_child: about to run '"C:\Program Files (x86)\Python32\python.exe" .py'
C:\Program Files (x86)\Python32\python.exe: can't open file '.py': [Errno 2] No such file or directory
child process exit code: 2


Note "Called with command line: .py" in output shows that filename was mangled very early on. Invoking `юникод.py` (which is associated with py.exe) directly works fine though.

The problem lies in Windows handling of command-line arguments and fix to this is simple but non-obvious. Patch attached.
History
Date User Action Args
2013-12-21 14:10:03zartsetrecipients: + zart, vstinner, ezio.melotti
2013-12-21 14:10:03zartsetmessageid: <1387635003.7.0.211054481065.issue20042@psf.upfronthosting.co.za>
2013-12-21 14:10:03zartlinkissue20042 messages
2013-12-21 14:10:02zartcreate