Commit e5bdad22 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2006)

On Windows, subprocess.Popen.communicate() now also ignore EINVAL
on stdin.write() if the child process is still running but closed the
pipe.
(cherry picked from commit d52aa313)
parent fe681397
...@@ -720,10 +720,11 @@ class Popen(object): ...@@ -720,10 +720,11 @@ class Popen(object):
if e.errno == errno.EPIPE: if e.errno == errno.EPIPE:
# communicate() should ignore broken pipe error # communicate() should ignore broken pipe error
pass pass
elif (e.errno == errno.EINVAL elif e.errno == errno.EINVAL:
and self.poll() is not None): # bpo-19612, bpo-30418: On Windows, stdin.write()
# Issue #19612: stdin.write() fails with EINVAL # fails with EINVAL if the child process exited or
# if the process already exited before the write # if the child process is still running but closed
# the pipe.
pass pass
else: else:
raise raise
......
...@@ -49,6 +49,9 @@ Extension Modules ...@@ -49,6 +49,9 @@ Extension Modules
Library Library
------- -------
- bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore EINVAL
on stdin.write() if the child process is still running but closed the pipe.
- bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot - bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
handle IPv6 addresses. handle IPv6 addresses.
......
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