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

Skip to content

Commit 1ddd407

Browse files
author
Jean-Paul Calderone
committed
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 f568218 commit 1ddd407

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
@@ -500,8 +500,8 @@ def list2cmdline(seq):
500500
501501
2) A string surrounded by double quotation marks is
502502
interpreted as a single argument, regardless of white space
503-
or pipe characters contained within. A quoted string can be
504-
embedded in an argument.
503+
contained within. A quoted string can be embedded in an
504+
argument.
505505
506506
3) A double quotation mark preceded by a backslash is
507507
interpreted as a literal double quotation mark.
@@ -529,7 +529,7 @@ def list2cmdline(seq):
529529
if result:
530530
result.append(' ')
531531

532-
needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or not arg
532+
needquote = (" " in arg) or ("\t" in arg) or not arg
533533
if needquote:
534534
result.append('"')
535535

Lib/test/test_subprocess.py

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

484482

485483
def test_poll(self):

0 commit comments

Comments
 (0)