Author martin.panter
Recipients martin.panter, vstinner
Date 2016-04-15.00:50:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460681460.12.0.489036747738.issue26721@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-04-15 00:51:00martin.pantersetrecipients: + martin.panter, vstinner
2016-04-15 00:51:00martin.pantersetmessageid: <1460681460.12.0.489036747738.issue26721@psf.upfronthosting.co.za>
2016-04-15 00:51:00martin.panterlinkissue26721 messages
2016-04-15 00:50:57martin.pantercreate