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

Skip to content

Commit 86c73bf

Browse files
author
Victor Stinner
committed
Issue #8780: Only backport the new test, the fix is not needed
Recorded merge of revisions 81403 via svnmerge from svn+ssh://[email protected]/python/branches/py3k ........ r81403 | victor.stinner | 2010-05-21 22:13:12 +0200 (ven., 21 mai 2010) | 5 lines Issue #8780: Fix a regression introduced by r78946 in subprocess on Windows Ensure that stdout / stderr is inherited from the parent if stdout=PIPE / stderr=PIPE is not used. ........
1 parent 8c5a7bb commit 86c73bf

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lib/test/test_subprocess.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,17 @@ def test_leaking_fds_on_error(self):
539539
if err.errno != 2: # ignore "no such file"
540540
raise
541541

542+
def test_issue8780(self):
543+
# Ensure that stdout is inherited from the parent
544+
# if stdout=PIPE is not used
545+
code = ';'.join((
546+
'import subprocess, sys',
547+
'retcode = subprocess.call('
548+
"[sys.executable, '-c', 'print(\"Hello World!\")'])",
549+
'assert retcode == 0'))
550+
output = subprocess.check_output([sys.executable, '-c', code])
551+
self.assert_(output.startswith(b'Hello World!'), ascii(output))
552+
542553
#
543554
# POSIX tests
544555
#

0 commit comments

Comments
 (0)