From: Victor Stinner Date: Tue, 18 Feb 2014 21:06:35 +0000 (+0100) Subject: (Merge 3.3) Issue #19612: On Windows, subprocess.Popen.communicate() now X-Git-Tag: v3.4.1rc1~233^2~289 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f47ac2aaab2a4f23897a680ed264e0ae2032b1c;p=thirdparty%2FPython%2Fcpython.git (Merge 3.3) Issue #19612: On Windows, subprocess.Popen.communicate() now ignores OSError(22, 'Invalid argument') when writing input data into stdin, whereas the process already exited. --- 5f47ac2aaab2a4f23897a680ed264e0ae2032b1c diff --cc Lib/subprocess.py index f47f5ab1dec7,86592a111de1..921670d5a982 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@@ -1185,8 -1192,16 +1185,16 @@@ class Popen(object) if input is not None: try: self.stdin.write(input) - except IOError as e: + except OSError as e: - if e.errno != errno.EPIPE: + if e.errno == errno.EPIPE: - # ignore pipe full error ++ # communicate() should ignore pipe full error + pass + elif (e.errno == errno.EINVAL + and self.poll() is not None): + # Issue #19612: stdin.write() fails with EINVAL + # if the process already exited before the write + pass + else: raise self.stdin.close() diff --cc Misc/NEWS index caad0969fe5c,aed4eff0a1d7..42ab220b989e --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -28,15 -20,10 +28,19 @@@ Core and Builtin Library ------- + - Issue #19612: On Windows, subprocess.Popen.communicate() now ignores + OSError(22, 'Invalid argument') when writing input data into stdin, whereas + the process already exited. + +- Issue #20320: select.select() and select.kqueue.control() now round the + timeout aways from zero, instead of rounding towards zero. + +- Issue #20616: Add a format() method to tracemalloc.Traceback. + +- Issue #19744: the ensurepip installation step now just prints a warning to + stderr rather than failing outright if SSL/TLS is unavailable. This allows + local installation of POSIX builds without SSL/TLS support. + - Issue #6815: os.path.expandvars() now supports non-ASCII environment variables names and values.