summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-21 20:13:12 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-21 20:13:12 (GMT)
commitb369358ee4a2ac39b9e276d765ee63f07049ecfc (patch)
treee681ec80563b9ccf762c4b109f3654cb4c78bbae /Lib/test
parentf978facc0e81bed85c990612401a63954542aebc (diff)
downloadcpython-b369358ee4a2ac39b9e276d765ee63f07049ecfc.zip
cpython-b369358ee4a2ac39b9e276d765ee63f07049ecfc.tar.gz
cpython-b369358ee4a2ac39b9e276d765ee63f07049ecfc.tar.bz2
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.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_subprocess.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 96c8ebf..0dd5da4 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -535,6 +535,17 @@ class ProcessTestCase(BaseTestCase):
if c.exception.errno != 2: # ignore "no such file"
raise c.exception
+ def test_issue8780(self):
+ # Ensure that stdout is inherited from the parent
+ # if stdout=PIPE is not used
+ code = ';'.join((
+ 'import subprocess, sys',
+ 'retcode = subprocess.call('
+ "[sys.executable, '-c', 'print(\"Hello World!\")'])",
+ 'assert retcode == 0'))
+ output = subprocess.check_output([sys.executable, '-c', code])
+ self.assert_(output.startswith(b'Hello World!'), ascii(output))
+
# context manager
class _SuppressCoreFiles(object):