summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-05 01:38:41 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-05 01:38:41 (GMT)
commit20f4bd4a043bded930c1c21befe28d9c79ea044b (patch)
tree5f729519b7d13865b602b5c8a252a6c718d0f056 /Lib/test/test_subprocess.py
parentf7f3b0a14a63ca355097fa2ee546d20888e39faa (diff)
downloadcpython-20f4bd4a043bded930c1c21befe28d9c79ea044b.zip
cpython-20f4bd4a043bded930c1c21befe28d9c79ea044b.tar.gz
cpython-20f4bd4a043bded930c1c21befe28d9c79ea044b.tar.bz2
Issue #21619: Try to fix test_broken_pipe_cleanup()
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r--Lib/test/test_subprocess.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index fc98da5..aaec322 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)