Issue #2304: Add additional quotes when using cmd shell on Windows. Original patch from Gabriel Genellina

This commit is contained in:
Tim Golden 2010-08-08 16:18:45 +00:00
parent e677ecfccf
commit 6fe8c41e8f
2 changed files with 44 additions and 2 deletions

View file

@ -853,7 +853,7 @@ class Popen(object):
startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = _subprocess.SW_HIDE
comspec = os.environ.get("COMSPEC", "cmd.exe")
args = comspec + " /c " + args
args = comspec + " /c " + '"%s"' % args
if (_subprocess.GetVersion() >= 0x80000000L or
os.path.basename(comspec).lower() == "command.com"):
# Win9x, or using command.com on NT. We need to