Martin Panter added the comment:

I suspect this bug does not affect Python 2. See my demo script wsgi-partial.py 
as evidence, which interrupts a 20 MB write with a signal.

Jason: If you look at Python 2’s file.write() API 
<https://docs.python.org/2/library/stdtypes.html#file.write>, perhaps that will 
convince you that it is easy for someone to write a write() method that has no 
return value.

Anyway, I think this bug is bigger than first thought. It affects most servers 
based on socketserver.StreamRequestHandler, not just the “wsgiref” one. In 
Python 3.5 I propose to patch the existing servers to avoid the possibility of 
truncated writes (patch forthcoming). In 3.6, I am thinking we should change 
StreamRequestHandler.wfile to prevent write() doing partial writes.

----------
versions:  -Python 2.7
Added file: http://bugs.python.org/file42411/wsgi-partial.py

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

Reply via email to