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 paul.moore
Recipients paul.moore, rengine
Date 2015-04-03.22:30:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428100237.61.0.79895679406.issue23862@psf.upfronthosting.co.za>
In-reply-to
Content
On Windows, subprocess.Popen has to convert an argument list to a command line (because that's what the OS expects for CreateProcess). It does so internally, using subprocess.list2cmdline, which follows the quoting rules for the MS C runtime (because that's what 99% of programs use). Unfortunately batfile argument parsing does *not* use these conventions, and you can find odd corner cases like this.

Specifically, it's not possible on Windows to "correctly" quote all forms of argument without knowing what program you are calling (because programs do their own argument parsing, usually but not always via the C runtime). The subprocess module has to work for unknown executables, so it chooses to do the right thing for programs using the MS C runtime argument parser (which is most programs).
History
Date User Action Args
2015-04-03 22:30:37paul.mooresetrecipients: + paul.moore, rengine
2015-04-03 22:30:37paul.mooresetmessageid: <1428100237.61.0.79895679406.issue23862@psf.upfronthosting.co.za>
2015-04-03 22:30:37paul.moorelinkissue23862 messages
2015-04-03 22:30:37paul.moorecreate