[Python-checkins] r53413 - in python/branches/release25-maint/Lib: subprocess.py test/test_subprocess.py

peter.astrand python-checkins at python.org
Sat Jan 13 23:37:12 CET 2007


Author: peter.astrand
Date: Sat Jan 13 23:37:11 2007
New Revision: 53413

Modified:
   python/branches/release25-maint/Lib/subprocess.py
   python/branches/release25-maint/Lib/test/test_subprocess.py
Log:
Fix for bug #1634343: allow specifying empty arguments on Windows

Modified: python/branches/release25-maint/Lib/subprocess.py
==============================================================================
--- python/branches/release25-maint/Lib/subprocess.py	(original)
+++ python/branches/release25-maint/Lib/subprocess.py	Sat Jan 13 23:37:11 2007
@@ -499,7 +499,7 @@
         if result:
             result.append(' ')
 
-        needquote = (" " in arg) or ("\t" in arg)
+        needquote = (" " in arg) or ("\t" in arg) or arg == ""
         if needquote:
             result.append('"')
 

Modified: python/branches/release25-maint/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/release25-maint/Lib/test/test_subprocess.py	(original)
+++ python/branches/release25-maint/Lib/test/test_subprocess.py	Sat Jan 13 23:37:11 2007
@@ -430,6 +430,8 @@
                          '"a\\\\b c" d e')
         self.assertEqual(subprocess.list2cmdline(['a\\\\b\\ c', 'd', 'e']),
                          '"a\\\\b\\ c" d e')
+        self.assertEqual(subprocess.list2cmdline(['ab', '']),
+                         'ab ""')
 
 
     def test_poll(self):


More information about the Python-checkins mailing list