diff options
author | Peter Astrand <astrand@lysator.liu.se> | 2007-01-13 22:37:11 (GMT) |
---|---|---|
committer | Peter Astrand <astrand@lysator.liu.se> | 2007-01-13 22:37:11 (GMT) |
commit | 29794ecd43efc2c1b33da2c4e5064f0a1a654342 (patch) | |
tree | 04e956136ed7dd63a7efce7c106eeb62e28d5c95 | |
parent | 4347c135ceaa2af4c42853f02c32d9c1e4c442fb (diff) | |
download | cpython-29794ecd43efc2c1b33da2c4e5064f0a1a654342.zip cpython-29794ecd43efc2c1b33da2c4e5064f0a1a654342.tar.gz cpython-29794ecd43efc2c1b33da2c4e5064f0a1a654342.tar.bz2 |
Fix for bug #1634343: allow specifying empty arguments on Windows
-rw-r--r-- | Lib/subprocess.py | 2 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index abd790d..eb1a735 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -499,7 +499,7 @@ def list2cmdline(seq): if result: result.append(' ') - needquote = (" " in arg) or ("\t" in arg) + needquote = (" " in arg) or ("\t" in arg) or arg == "" if needquote: result.append('"') diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 64f8d40..c2db6fa 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -430,6 +430,8 @@ class ProcessTestCase(unittest.TestCase): '"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): |