[issue21619] Cleaning up a subprocess with a broken pipe
Martin Panter
report at bugs.python.org
Tue Mar 3 12:08:57 CET 2015
Martin Panter added the comment:
Aha! So perhaps Windows can accept a small amount of data into its pipe buffer even if we know the pipe has been broken. That kind of makes sense. Test case could be modified to:
proc = subprocess.Popen([...], bufsize=support.PIPE_MAX_SIZE, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
proc.stdout.read() # Make sure subprocess has closed its input
proc.stdin.write(bytes(support.PIPE_MAX_SIZE))
self.assertIsNone(proc.returncode)
# Expect EPIPE under POSIX and EINVAL under Windows
self.assertRaises(OSError, proc.__exit__, None, None, None)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21619>
_______________________________________
More information about the Python-bugs-list
mailing list