Commit d5c8ce7c authored by Victor Stinner's avatar Victor Stinner

Issue #19612: On Windows, subprocess.Popen.communicate() now ignores

OSError(22, 'Invalid argument') when writing input data into stdin, whereas
the process already exited.
parent 9e5a9876
...@@ -1193,7 +1193,15 @@ class Popen(object): ...@@ -1193,7 +1193,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:
# 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 raise
self.stdin.close() self.stdin.close()
......
...@@ -20,6 +20,10 @@ Core and Builtins ...@@ -20,6 +20,10 @@ Core and Builtins
Library 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 #6815: os.path.expandvars() now supports non-ASCII environment - Issue #6815: os.path.expandvars() now supports non-ASCII environment
variables names and values. variables names and values.
......
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