Josiah Carlson added the comment:

I ended up eliminating the overlapped IO cancel call on Windows. Better to be 
correct than to minimize internal state. Instead, we keep a reference to the 
overlapped IO object, and any attempts to write to the child stdin before the 
previous overlapped IO completes are kicked back as a 0 byte write. The 
communicate() method does the right thing with pre-existing non-blocking 
writes, whether input is passed or not.

I also eliminated universal_newline support for non-blocking reads and writes 
to prevent error conditions on edge cases:

On the write side of things, you could end up with a partial multi-byte 
character write, which with universal newlines, would be impossible to finish 
the send using the public API without first modifying state attributes on the 
Popen object (disabling universal newlines for a subsequent bytes 
write_nonblocking() call).

On the read side of things, if you get a partial read of a multi-byte 
character, then the subsequent decode operation would fail with a 
UnicodeDecodeError. Though you could pull the original bytes from the 
exception, that's an awful API to create.

----------
Added file: http://bugs.python.org/file34851/subprocess_4.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1191964>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to