changeset: 94852:77a978716517 branch: 3.4 parent: 94847:01cf9ce75eda user: Victor Stinner date: Thu Mar 05 02:38:41 2015 +0100 files: Lib/test/test_subprocess.py description: Issue #21619: Try to fix test_broken_pipe_cleanup() diff -r 01cf9ce75eda -r 77a978716517 Lib/test/test_subprocess.py --- a/Lib/test/test_subprocess.py Wed Mar 04 20:51:55 2015 +0100 +++ b/Lib/test/test_subprocess.py Thu Mar 05 02:38:41 2015 +0100 @@ -2523,13 +2523,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)