diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/subprocess.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index d75a4e0..86592a1 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1193,7 +1193,15 @@ class Popen(object): try: self.stdin.write(input) 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 self.stdin.close() |