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.

classification
Title: subprocess interpreted double quotation wrong on windows
Type: Stage:
Components: Windows Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: astrand Nosy List: astrand, simonhang
Priority: normal Keywords:

Created on 2006-03-09 04:26 by simonhang, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg27724 - (view) Author: simon (simonhang) Date: 2006-03-09 04:26
If we run below python command
print subprocess.Popen([r'c:\test.bat', 
r'test"string:']).pid
Actually c:\test.bat test\"string\" is executed.
Module subprocess doesn't interpret double quotation 
mark right. Back slash shouldn't be added.

I believe problem is in function 
subprocess.list2cmdline.
msg27725 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2006-07-10 20:12
Logged In: YES 
user_id=344921

As far as I can tell, there's nothing wrong with
subprocess.list2cmdline. Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/progs_12.asp.
There, you will find:

ab"c

which corresponds to:

"ab\"c"

In other words: a backslash should be added when converting
from an argument to a string. Or do you intepret the MS web
page differently?
msg27726 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2007-01-22 19:12
No response from reporter, we confirm to the MS documentation as far as I can tell. 
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 43001
2006-03-09 04:26:20simonhangcreate