diff options
author | Charles-François Natali <neologix@free.fr> | 2011-05-29 14:36:44 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-05-29 14:36:44 (GMT) |
commit | 2d517218320af6f752eaf1fbd96466e8d13d2d20 (patch) | |
tree | 5267963086203ea7d18b8bcca1d9969e1420c021 /Lib/test/test_subprocess.py | |
parent | b30eed981f54711d0a27ced68e15b8a5dd9934bc (diff) | |
download | cpython-2d517218320af6f752eaf1fbd96466e8d13d2d20.zip cpython-2d517218320af6f752eaf1fbd96466e8d13d2d20.tar.gz cpython-2d517218320af6f752eaf1fbd96466e8d13d2d20.tar.bz2 |
Issue #12196: Add PIPE_MAX_SIZE to test.support, constant larger than the
underlying OS pipe buffer size.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 2eeff72..686c1b1 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -489,24 +489,21 @@ class ProcessTestCase(BaseTestCase): # This test will probably deadlock rather than fail, if # communicate() does not work properly. x, y = os.pipe() - if mswindows: - pipe_buf = 512 - else: - pipe_buf = os.fpathconf(x, "PC_PIPE_BUF") os.close(x) os.close(y) p = subprocess.Popen([sys.executable, "-c", 'import sys,os;' 'sys.stdout.write(sys.stdin.read(47));' - 'sys.stderr.write("xyz"*%d);' - 'sys.stdout.write(sys.stdin.read())' % pipe_buf], + 'sys.stderr.write("x" * %d);' + 'sys.stdout.write(sys.stdin.read())' % + support.PIPE_MAX_SIZE], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.addCleanup(p.stdout.close) self.addCleanup(p.stderr.close) self.addCleanup(p.stdin.close) - string_to_write = b"abc"*pipe_buf + string_to_write = b"a" * support.PIPE_MAX_SIZE (stdout, stderr) = p.communicate(string_to_write) self.assertEqual(stdout, string_to_write) |