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.

Title: subprocess interpreted double quotation wrong on windows
Type: Stage:
Components: Windows Versions: Python 2.4
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', 
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 
msg27725 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2006-07-10 20:12
Logged In: YES 

As far as I can tell, there's nothing wrong with
subprocess.list2cmdline. Take a look at
There, you will find:


which corresponds to:


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. 
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 43001
2006-03-09 04:26:20simonhangcreate