Commit b2291231 authored by Victor Stinner's avatar Victor Stinner

Issue #19612: subprocess.communicate() now also ignores EINVAL when using at

least two pipes.
parent d4254fbb
...@@ -1035,7 +1035,15 @@ class Popen(object): ...@@ -1035,7 +1035,15 @@ class Popen(object):
try: try:
self.stdin.write(input) self.stdin.write(input)
except IOError as e: except IOError as e:
if e.errno != errno.EPIPE: if e.errno == errno.EPIPE:
# communicate() should ignore broken pipe 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 raise
self.stdin.close() self.stdin.close()
......
...@@ -13,6 +13,9 @@ Core and Builtins ...@@ -13,6 +13,9 @@ Core and Builtins
Library Library
------- -------
- Issue #19612: subprocess.communicate() now also ignores EINVAL when using at
least two pipes.
- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError - Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
on closed socket. on closed socket.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment