cpython: 423cb79640eb (original) (raw)
Mercurial > cpython
changeset 89260:423cb79640eb
(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. [#19612]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Tue, 18 Feb 2014 22:06:35 +0100 |
parents | 587fd4b91120(current diff)83013a7be836(diff) |
children | 5202aca8a673 |
files | Lib/subprocess.py Misc/NEWS |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-)[+] [-] Lib/subprocess.py 10 Misc/NEWS 4 |
line wrap: on
line diff
--- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1186,7 +1186,15 @@ class Popen(object): try: self.stdin.write(input) except OSError as e:
if e.errno != errno.EPIPE:[](#l1.7)
if e.errno == errno.EPIPE:[](#l1.8)
# communicate() should ignore pipe full error[](#l1.9)
pass[](#l1.10)
elif (e.errno == errno.EINVAL[](#l1.11)
and self.poll() is not None):[](#l1.12)
# Issue #19612: stdin.write() fails with EINVAL[](#l1.13)
# if the process already exited before the write[](#l1.14)
pass[](#l1.15)
else:[](#l1.16) raise[](#l1.17) self.stdin.close()[](#l1.18)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -28,6 +28,10 @@ Core and Builtins Library ------- +- Issue #19612: On Windows, subprocess.Popen.communicate() now ignores