mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
(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.
This commit is contained in:
commit
5f47ac2aaa
2 changed files with 13 additions and 1 deletions
|
@ -1186,7 +1186,15 @@ class Popen(object):
|
||||||
try:
|
try:
|
||||||
self.stdin.write(input)
|
self.stdin.write(input)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != errno.EPIPE:
|
if e.errno == errno.EPIPE:
|
||||||
|
# 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
|
raise
|
||||||
self.stdin.close()
|
self.stdin.close()
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,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 #20320: select.select() and select.kqueue.control() now round the
|
- Issue #20320: select.select() and select.kqueue.control() now round the
|
||||||
timeout aways from zero, instead of rounding towards zero.
|
timeout aways from zero, instead of rounding towards zero.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue