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 r.david.murray
Recipients Arve.Knudsen, exarkun, piotr.dobrogost, r.david.murray, sbt
Date 2013-08-04.16:12:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This is a only a duplicate of issue 1300 in the sense that that issue points out that list2cmdline has nothing to do with passing/quoting strings for cmd.exe.

list2cmdline is an internal function of the subprocess module.  Its docstring documents the MS C quoting rules, *not* the input quoting rules.  So its output is correct according to its doc string.  If you pass ["test.bat", r'\"1|2\"'] to Popen using Richard's version of test.bat, you should get


as the output, which would be correct, since that is what you passed in as the argument to test.bat in the Popen call.  The point is that the arguments specified in the list (shell=False) Popen call is supposed to be exactly what arguments get passed to the called program, and list2cmdline takes care of the MS C quoting to make that happen. (I don't use Windows much, so it is a bit of a pain for me to confirm the above example, but I'm nearly certain it will work as I say, modulo whatever quoting rule 'echo' uses for output.)
Date User Action Args
2013-08-04 16:12:55r.david.murraysetrecipients: + r.david.murray, exarkun, Arve.Knudsen, sbt, piotr.dobrogost
2013-08-04 16:12:55r.david.murraysetmessageid: <>
2013-08-04 16:12:55r.david.murraylinkissue18649 messages
2013-08-04 16:12:55r.david.murraycreate