cpython: 16a386443055 (original) (raw)

Mercurial > cpython

changeset 68684:16a386443055

merge from upstream

Skip Montanaro skip@pobox.com
date Sat, 19 Mar 2011 13:03:33 -0500
parents 64eeb4cd4b56(current diff)cb148da52c47(diff)
children 145c3703ce48
files
diffstat 6 files changed, 24 insertions(+), 5 deletions(-)[+] [-] Doc/library/platform.rst 2 Lib/os.py 4 Lib/platform.py 2 Lib/subprocess.py 2 Lib/test/test_subprocess.py 16 Misc/NEWS 3

line wrap: on

line diff

--- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -208,7 +208,7 @@ Windows Platform Win95/98 specific ^^^^^^^^^^^^^^^^^ -.. function:: popen(cmd, mode='r', bufsize=None) +.. function:: popen(cmd, mode='r', bufsize=-1) Portable :func:popen interface. Find a working popen implementation preferring :func:win32pipe.popen. On Windows NT, :func:win32pipe.popen

--- a/Lib/os.py +++ b/Lib/os.py @@ -779,11 +779,13 @@ if not _exists("urandom"): return bs

Supply os.popen()

-def popen(cmd, mode="r", buffering=None): +def popen(cmd, mode="r", buffering=-1): if not isinstance(cmd, str): raise TypeError("invalid cmd type (%s, expected string)" % type(cmd)) if mode not in ("r", "w"): raise ValueError("invalid mode %r" % mode)

--- a/Lib/platform.py +++ b/Lib/platform.py @@ -357,7 +357,7 @@ def dist(distname='',version='',id='', supported_dists=supported_dists, full_distribution_name=0) -def popen(cmd, mode='r', bufsize=None): +def popen(cmd, mode='r', bufsize=-1): """ Portable popen() interface. """

--- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -743,8 +743,6 @@ class Popen(object): if errread != -1: errread = msvcrt.open_osfhandle(errread.Detach(), 0)

--- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1315,6 +1315,22 @@ class POSIXProcessTestCase(BaseTestCase) " non-zero with this error:\n%s" % stderr.decode('utf-8'))

+ @unittest.skipUnless(mswindows, "Windows specific tests") class Win32ProcessTestCase(BaseTestCase):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -75,6 +75,9 @@ Core and Builtins Library ------- +- Issue #11459: A bufsize value of 0 in subprocess.Popen() really creates