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 sbt
Recipients Arve.Knudsen, exarkun, piotr.dobrogost, r.david.murray, sbt
Date 2013-08-04.13:55:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Firstly, list2cmdline() takes a list as its argument, not a string:

  >>> import subprocess
  >>> print subprocess.list2cmdline([r'\"1|2\"'])

But the problem with passing arguments to a batch file is that cmd.exe parses arguments differently from how normal executables do.  In particular, "|" is treated specially and "^" is used as an escape character.

If you define test.bat as

  @echo off
  echo "%1"

then['test.bat', '1^|2'])



as expected.

This is a duplicate of
Date User Action Args
2013-08-04 13:55:36sbtsetrecipients: + sbt, exarkun, r.david.murray, Arve.Knudsen, piotr.dobrogost
2013-08-04 13:55:36sbtsetmessageid: <>
2013-08-04 13:55:36sbtlinkissue18649 messages
2013-08-04 13:55:36sbtcreate