[issue1300] subprocess.list2cmdline doesn't do pipe symbols
report at bugs.python.org
Sat Jun 19 20:16:35 CEST 2010
Jean-Paul Calderone <exarkun at twistedmatrix.com> added the comment:
It will return the former.
To clarify, it's true that there appears to be a problem with Popen(['echo', 'foo|bar'], shell=True). That is being tracked in issue7839.
What's invalid is the report that list2cmdline() should be quoting strings with | in them. list2cmdline() is documented as being an implementation of the quoting convention implemented by the MS C runtime. That quoting convention does not require | to be quoted.
It's cmd.exe which requires | to be quoted (if it is to be part of an argument value, rather than to indicate a command pipeline of some sort). cmd.exe quoting rules need to be addressed separately from the MS C quoting rules used even if cmd.exe isn't involved.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list