Index: Lib/test/test_subprocess.py =================================================================== --- Lib/test/test_subprocess.py (révision 81394) +++ Lib/test/test_subprocess.py (copie de travail) @@ -535,7 +535,18 @@ if c.exception.errno != 2: # ignore "no such file" raise c.exception + def test_issue8780(self): + # Ensure that stdout if 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): """Try to prevent core files from being created.""" Index: Lib/subprocess.py =================================================================== --- Lib/subprocess.py (révision 81394) +++ Lib/subprocess.py (copie de travail) @@ -843,7 +843,7 @@ # Process startup details if startupinfo is None: startupinfo = STARTUPINFO() - if None not in (p2cread, c2pwrite, errwrite): + if -1 not in (p2cread, c2pwrite, errwrite): startupinfo.dwFlags |= _subprocess.STARTF_USESTDHANDLES startupinfo.hStdInput = p2cread startupinfo.hStdOutput = c2pwrite