[Python-checkins] cpython (3.3): Use a larger amount of data for tests such as the interrupted_write

gregory.p.smith python-checkins at python.org
Wed Mar 20 07:27:25 CET 2013


http://hg.python.org/cpython/rev/993b7e0eb8be
changeset:   82831:993b7e0eb8be
branch:      3.3
parent:      82825:e1fdda86e937
user:        Gregory P. Smith <greg at krypto.org>
date:        Tue Mar 19 23:25:16 2013 -0700
summary:
  Use a larger amount of data for tests such as the interrupted_write
tests that depend on filling up an OS pipe so that they work properly
on systems configured with large pipe buffers.

files:
  Lib/subprocess.py   |  7 +++++--
  Lib/test/support.py |  6 +++---
  2 files changed, 8 insertions(+), 5 deletions(-)


diff --git a/Lib/subprocess.py b/Lib/subprocess.py
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -166,7 +166,7 @@
     '/bin/ls'
 
 check_output(*popenargs, **kwargs):
-    Run command with arguments and return its output as a byte string.
+    Run command with arguments and return its output.
 
     If the exit code was non-zero it raises a CalledProcessError.  The
     CalledProcessError object will have the return code in the returncode
@@ -547,7 +547,7 @@
 
 
 def check_output(*popenargs, timeout=None, **kwargs):
-    r"""Run command with arguments and return its output as a byte string.
+    r"""Run command with arguments and return its output.
 
     If the exit code was non-zero it raises a CalledProcessError.  The
     CalledProcessError object will have the return code in the returncode
@@ -565,6 +565,9 @@
     ...               "ls -l non_existent_file ; exit 0"],
     ...              stderr=STDOUT)
     b'ls: non_existent_file: No such file or directory\n'
+
+    If universal_newlines=True is passed, the return value will be a
+    string rather than bytes.
     """
     if 'stdout' in kwargs:
         raise ValueError('stdout argument not allowed, it will be overridden.')
diff --git a/Lib/test/support.py b/Lib/test/support.py
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -574,9 +574,9 @@
 
 
 # A constant likely larger than the underlying OS pipe buffer size.
-# Windows limit seems to be around 512B, and most Unix kernels have a 64K pipe
-# buffer size: take 1M to be sure.
-PIPE_MAX_SIZE = 1024 * 1024
+# Windows limit seems to be around 512B, and many Unix kernels have a 64K pipe
+# buffer size or 16*PAGE_SIZE: take a few megs to be sure.  This
+PIPE_MAX_SIZE = 3 * 1000 * 1000
 
 
 # decorator for skipping tests on non-IEEE 754 platforms

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


More information about the Python-checkins mailing list