From: Victor Stinner Date: Thu, 5 Mar 2015 01:38:41 +0000 (+0100) Subject: Issue #21619: Try to fix test_broken_pipe_cleanup() X-Git-Tag: v3.5.0a2~30^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20f4bd4a043bded930c1c21befe28d9c79ea044b;p=thirdparty%2FPython%2Fcpython.git Issue #21619: Try to fix test_broken_pipe_cleanup() --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index fc98da501560..aaec3229f8f0 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -2523,13 +2523,16 @@ class ContextManagerTests(BaseTestCase): 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)