Ticket #5365 defect new
_pollingfile makes wrong assumption about WriteFile
|Reported by:||antoine||Owned by:||johnnypops|
(diff, github, buildbot, log)
_pollingfile assumes that (win32 API) WriteFile() will allow a partial write, but WriteFile() writes either all or nothing. Which means if you try to write too much at once in a pipe's buffer, the _PollableWritePipe sits there doing nothing (in a polling loop :-)).
test_stdio.StandardInputOutputTestCase.test_consumer conveniently tries to consume less than 4096 bytes, which is apparently the default buffer size of Windows anonymous pipes. With the attached patch growing the total transfer size in that test case, test_stdio.StandardInputOutputTestCase.test_consumer hangs here with Python 2.7 under 64-bit Windows 7.