On 08/08/2010 11:31 PM, Eric Smith wrote:
On 8/8/10 12:18 PM, tim.golden wrote:
Modified: python/branches/release31-maint/Lib/subprocess.py
==============================================================================
--- python/branches/release31-maint/Lib/subprocess.py   (original)
+++ python/branches/release31-maint/Lib/subprocess.py   Sun Aug  8 18:18:18 2010
@@ -829,7 +829,7 @@
                   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()>= 0x80000000 or
                           os.path.basename(comspec).lower() == "command.com"):
                       # Win9x, or using command.com on NT. We need to

If args is a tuple, this fails with a TypeError. I realize args
shouldn't be a tuple, but that's not a great failure if it is. I think
this would be better written as:

       args = '{} /c "{}"'.format(compspec, args)



Thanks, Eric. I'll rework.

TJG
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to