PJ Eby added the comment:

You're right, it shouldn't send the headers until a non-empty string
occurs.  I don't see any problem with treating it as a bug, and fixing it.
Your patch will also allow non-compliant behavior, though.  It seems to me
it would be better to fix the logic in write() to not call send_headers()
if len(data)==0.  That way, it will still error with "write() before
start_response()" in the non-compliant case, but fix the compliance error.
Feel free to reopen/retitle this issue for that.

----------

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

Reply via email to