[Python-checkins] cpython (merge 3.4 -> default): Merge 3.4 (test_subprocess)

victor.stinner python-checkins at python.org
Thu Mar 5 02:42:09 CET 2015


https://hg.python.org/cpython/rev/36c62d9f8752
changeset:   94853:36c62d9f8752
parent:      94851:7cea10917f40
parent:      94852:77a978716517
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Mar 05 02:40:17 2015 +0100
summary:
  Merge 3.4 (test_subprocess)

files:
  Lib/test/test_subprocess.py |  15 +++++++++------
  1 files changed, 9 insertions(+), 6 deletions(-)


diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -2504,13 +2504,16 @@
 
     def test_broken_pipe_cleanup(self):
         """Broken pipe error should not prevent wait() (Issue 21619)"""
-        proc = subprocess.Popen([sys.executable, "-c",
-                "import sys;"
-                "sys.stdin.close();"
-                "sys.stdout.close();"  # Signals that input pipe is closed
-        ], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+        args = [sys.executable, "-c",
+               "import sys;"
+               "sys.stdin.close();"
+               "sys.stdout.close();"]   # Signals that input pipe is closed
+        proc = subprocess.Popen(args,
+                                stdin=subprocess.PIPE,
+                                stdout=subprocess.PIPE,
+                                bufsize=support.PIPE_MAX_SIZE*2)
         proc.stdout.read()  # Make sure subprocess has closed its input
-        proc.stdin.write(b"buffered data")
+        proc.stdin.write(b"x" * support.PIPE_MAX_SIZE)
         self.assertIsNone(proc.returncode)
         self.assertRaises(OSError, proc.__exit__, None, None, None)
         self.assertEqual(0, proc.returncode)

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list