[Python-Dev] [Python-checkins] r83831 - in python/branches/release31-maint/Lib: subprocess.py test/test_subprocess.py
Tim Golden
mail at timgolden.me.uk
Mon Aug 9 07:01:45 CEST 2010
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
More information about the Python-Dev
mailing list