[Python-checkins] r81408 - in python/branches/release31-maint: Lib/test/test_subprocess.py

victor.stinner python-checkins at python.org
Fri May 21 22:39:17 CEST 2010


Author: victor.stinner
Date: Fri May 21 22:39:17 2010
New Revision: 81408

Log:
Issue #8780: Only backport the new test, the fix is not needed

Recorded merge of revisions 81403 via svnmerge from
svn+ssh://pythondev@svn.python.org/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.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Lib/test/test_subprocess.py

Modified: python/branches/release31-maint/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_subprocess.py	(original)
+++ python/branches/release31-maint/Lib/test/test_subprocess.py	Fri May 21 22:39:17 2010
@@ -539,6 +539,17 @@
                 if err.errno != 2:  # ignore "no such file"
                     raise
 
+    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))
+
     #
     # POSIX tests
     #


More information about the Python-checkins mailing list