[issue8972] subprocess.list2cmdline doesn't quote the character

2010-06-18 Thread shypike
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

[issue8972] subprocess.list2cmdline doesn't quote the character

2010-06-13 Thread shypike
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

[issue8972] subprocess.list2cmdline doesn't quote the character

2010-06-12 Thread shypike
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

[issue8972] subprocess.list2cmdline doesn't quote the character

2010-06-12 Thread shypike
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

[issue8972] subprocess.list2cmdline doesn't quote the character

2010-06-11 Thread shypike
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