Index: Doc/lib/libos.tex =================================================================== --- Doc/lib/libos.tex (revision 51868) +++ Doc/lib/libos.tex (working copy) @@ -366,6 +366,10 @@ \cfunction{_popen()} function from the libraries provided with Windows. Newer versions of Python do not use the broken implementation from the Windows libraries]{2.0} +\versionchanged[Earlier versions would run the string directly +with cmd.exe /c on Windows. It now adds a pair of quotes around +the command line string, to support cases where the command +line string already contains multiple pairs of quotes]{2.6} \end{funcdesc} \begin{funcdesc}{tmpfile}{} Index: Modules/posixmodule.c =================================================================== --- Modules/posixmodule.c (revision 51868) +++ Modules/posixmodule.c (working copy) @@ -4633,10 +4633,10 @@ if (GetVersion() < 0x80000000 && _stricmp(comshell, "command.com") != 0) { /* NT/2000 and not using command.com. */ - x = i + strlen(s3) + strlen(cmdstring) + 1; + x = i + strlen(s3) + strlen(cmdstring) + 3; s2 = (char *)alloca(x); ZeroMemory(s2, x); - PyOS_snprintf(s2, x, "%s%s%s", s1, s3, cmdstring); + PyOS_snprintf(s2, x, "%s%s\"%s\"", s1, s3, cmdstring); } else { /*