From 10514a70ace6ba5b67d2b34dc4c0738d30f51226 Mon Sep 17 00:00:00 2001 From: Peter Astrand Date: Sat, 13 Jan 2007 22:35:35 +0000 Subject: [PATCH] Fix for bug #1634343: allow specifying empty arguments on Windows --- Lib/subprocess.py | 2 +- Lib/test/test_subprocess.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index ea1e0d1e12..8b25c2fe85 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 64f8d40a40..c2db6fab20 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): -- 2.50.1