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 copelnug
Recipients copelnug, dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-07-31.17:40:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533058834.14.0.56676864532.issue34297@psf.upfronthosting.co.za>
In-reply-to
Content
Using double quote around the version argument will cause a failure.

Ex (failure): "py.exe" "-3" "test.py" 
=> run_child: about to run '3" "...\python.exe" "test.py"'
=> ...\python.exe: can't open file '3 test.py': [Errno 22] Invalid argument

Removing the double quote give (success): "py.exe" -3 "test.py" => run_child: about to run '"...\python.exe" "test.py"'

This is mainly problematic when a library or a tool want to be simpler and simply add double quotes around every parameters. This is impossible to do with the python launcher.

The issue seems to come from the PC/launcher.c file. It is the following line in the function process (around line 1622): command += wcslen(p);

This line is suppose to skip the -3 in the command line so that the rest can be given to python as-is. The problem is that while command come from GetCommandLineW and thus contain quote, p come from __wargv and does not contain the double quote. Thus, the 2 characters "- are skipped instead of -3.
History
Date User Action Args
2018-07-31 17:40:34copelnugsetrecipients: + copelnug, paul.moore, tim.golden, eric.araujo, zach.ware, steve.dower, dstufft
2018-07-31 17:40:34copelnugsetmessageid: <1533058834.14.0.56676864532.issue34297@psf.upfronthosting.co.za>
2018-07-31 17:40:34copelnuglinkissue34297 messages
2018-07-31 17:40:34copelnugcreate