File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -778,19 +778,21 @@ def _stdin_write(self, input):
778
778
self .stdin .write (input )
779
779
except BrokenPipeError :
780
780
pass # communicate() must ignore broken pipe errors.
781
- except OSError as e :
782
- if e .errno == errno .EINVAL and self .poll () is not None :
783
- # Issue #19612: On Windows, stdin.write() fails with EINVAL
784
- # if the process already exited before the write
781
+ except OSError as exc :
782
+ if exc .errno == errno .EINVAL :
783
+ # bpo-19612, bpo-30418: On Windows, stdin.write() fails
784
+ # with EINVAL if the child process exited or if the child
785
+ # process is still running but closed the pipe.
785
786
pass
786
787
else :
787
788
raise
789
+
788
790
try :
789
791
self .stdin .close ()
790
792
except BrokenPipeError :
791
793
pass # communicate() must ignore broken pipe errors.
792
- except OSError as e :
793
- if e .errno == errno .EINVAL and self . poll () is not None :
794
+ except OSError as exc :
795
+ if exc .errno == errno .EINVAL :
794
796
pass
795
797
else :
796
798
raise
Original file line number Diff line number Diff line change @@ -350,6 +350,9 @@ Extension Modules
350
350
Library
351
351
-------
352
352
353
+ - bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore EINVAL
354
+ on stdin.write() if the child process is still running but closed the pipe.
355
+
353
356
- bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers
354
357
to deny __dict__ and __weakref__ creation. Patch by Aaron Hall.
355
358
You can’t perform that action at this time.
0 commit comments