shypike shyp...@sabnzbd.org added the comment:
I see your point about passing a command line as a single string instead of a
list. Too bad that Popen doesn't just do the obvious thing (assemble the list
into a string in a shell/cmd.exe compatible way).
Issue 1300 should indeed be reversed
shypike shyp...@sabnzbd.org added the comment:
The discussion is going the wrong way. Let me state what is the actual problem.
When the Popen() function is called with shell=True, you cannot pass command
line elements in which the characters '' and '|' are embedded (example
r'QA
shypike shyp...@sabnzbd.org added the comment:
Added patch file for subprocess.py and test_subprocess.py.
--
keywords: +patch
Added file: http://bugs.python.org/file17645/list2cmdline_ampersand_fix.patch
___
Python tracker rep...@bugs.python.org
http
shypike shyp...@sabnzbd.org added the comment:
A work-around could be that the caller puts double quotes around the individual
elements of the sequence that need it.
However, this won't work because list2cmdline doesn't handle backslash quoting
properly. An element like r'foo' is translated
New submission from shypike shyp...@sabnzbd.org:
subprocess.py/list2cmdline should also put double quotes around strings that
contain ampersands (), but no spaces.
If not, the Windows command processor will split the command into two separate
parts. In short, '' needs the same treatment