Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2323d20

Browse files
author
Jean-Paul Calderone
committed
Merged revisions 82076 via svnmerge from
svn+ssh://[email protected]/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://[email protected]/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. ........ ................
1 parent 62f080c commit 2323d20

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

Lib/subprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ def list2cmdline(seq):
479479
480480
2) A string surrounded by double quotation marks is
481481
interpreted as a single argument, regardless of white space
482-
or pipe characters contained within. A quoted string can be
483-
embedded in an argument.
482+
contained within. A quoted string can be embedded in an
483+
argument.
484484
485485
3) A double quotation mark preceded by a backslash is
486486
interpreted as a literal double quotation mark.
@@ -508,7 +508,7 @@ def list2cmdline(seq):
508508
if result:
509509
result.append(' ')
510510

511-
needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or not arg
511+
needquote = (" " in arg) or ("\t" in arg) or not arg
512512
if needquote:
513513
result.append('"')
514514

Lib/test/test_subprocess.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,6 @@ def test_list2cmdline(self):
477477
'"a\\\\b\\ c" d e')
478478
self.assertEqual(subprocess.list2cmdline(['ab', '']),
479479
'ab ""')
480-
self.assertEqual(subprocess.list2cmdline(['echo', 'foo|bar']),
481-
'echo "foo|bar"')
482480

483481

484482
def test_poll(self):

0 commit comments

Comments
 (0)