summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@divmod.com>2010-06-18 20:11:43 (GMT)
committerJean-Paul Calderone <exarkun@divmod.com>2010-06-18 20:11:43 (GMT)
commit2323d202896252706dd8ac1a73f11e93fae79822 (patch)
treecd3f602074018ab1bdc5c787899509624e8c20d0
parent62f080c22e313c97450d2c23d86a97fb55915a2f (diff)
downloadcpython-2323d202896252706dd8ac1a73f11e93fae79822.zip
cpython-2323d202896252706dd8ac1a73f11e93fae79822.tar.gz
cpython-2323d202896252706dd8ac1a73f11e93fae79822.tar.bz2
Merged revisions 82076 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r82076 | jean-paul.calderone | 2010-06-18 16:03:54 -0400 (Fri, 18 Jun 2010) | 19 lines Merged revisions 82075 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r82075 | jean-paul.calderone | 2010-06-18 16:00:17 -0400 (Fri, 18 Jun 2010) | 12 lines Revert r60115 This revision introduced quoting for strings containing | based on a misunderstanding of the commonly used quoting rules used on Windows. | is interpreted by cmd.exe, not by the MS C runtime argv initializer. It only needs to be quoted if it is part of an argument passed through cmd.exe. See issue1300, issue7839, and issue8972. ........ ................
-rw-r--r--Lib/subprocess.py6
-rw-r--r--Lib/test/test_subprocess.py2
2 files changed, 3 insertions, 5 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 74b049f..1b774bc 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -479,8 +479,8 @@ def list2cmdline(seq):
2) A string surrounded by double quotation marks is
interpreted as a single argument, regardless of white space
- or pipe characters contained within. A quoted string can be
- embedded in an argument.
+ contained within. A quoted string can be embedded in an
+ argument.
3) A double quotation mark preceded by a backslash is
interpreted as a literal double quotation mark.
@@ -508,7 +508,7 @@ def list2cmdline(seq):
if result:
result.append(' ')
- needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or not arg
+ needquote = (" " in arg) or ("\t" in arg) or not arg
if needquote:
result.append('"')
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index f69172a..0f3f35d 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -477,8 +477,6 @@ class ProcessTestCase(unittest.TestCase):
'"a\\\\b\\ c" d e')
self.assertEqual(subprocess.list2cmdline(['ab', '']),
'ab ""')
- self.assertEqual(subprocess.list2cmdline(['echo', 'foo|bar']),
- 'echo "foo|bar"')
def test_poll(self):