Index: Doc/library/os.rst =================================================================== --- Doc/library/os.rst (revision 77505) +++ Doc/library/os.rst (working copy) @@ -414,7 +414,13 @@ provided with Windows. Newer versions of Python do not use the broken implementation from the Windows libraries. + .. versionchanged:: 2.7 + Earlier versions would run the *command* string directly with + ``cmd.exe /c`` on Windows. Internally, the *command* string is now + surrounded with quotes, to support cases where the command itself + contains quotes. + .. function:: tmpfile() Return a new file object opened in update mode (``w+b``). The file has no Index: Modules/posixmodule.c =================================================================== --- Modules/posixmodule.c (revision 77505) +++ Modules/posixmodule.c (working copy) @@ -4984,10 +4984,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 { /*