Martin Panter added the comment:

If a user calls makefile(bufsize=0), they may have written that based on Python 
2’s behaviour of always doing full writes. But in Python 3 this is indirectly 
documented as doing partial writes: makefile() args interpreted as for open, 
and open() buffering disabled returns a RawIOBase subclass.

People porting code from Python 2 may be unprepared for partial writes. Just 
another subtle Python 2 vs 3 incompatibility. People using only Python 3 might 
be unprepared if they are not familar with the intricacies of the Python API, 
but then why are they using bufsize=0? On the other hand, they might require 
partial writes if they are using select() or similar, so changing it would be a 
compatibility problem.

You could use the same arguments for socketserver. The difference is that wfile 
being in raw mode is not documented. Almost all of the relevant builtin library 
code that I reviewed expects full blocking writes, and I did not find any that 
requires partial writes. So I think making the change in socketserver is less 
likely to introduce compatibility problems, and is much more beneficial.

----------

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

Reply via email to