Martin Panter <vadmium...@gmail.com> added the comment:

The 1 MiB limit was added for Issue 1296004; apparently some platforms were 
overallocating multiple buffers and running out of memory. I suspect the loop 
in "_safe_read" was inherited from Python 2, which has different kinds of file 
objects. The comments suggest it does partial reads.

But the Python 3 code calls "socket.makefile" with "buffering" mode enabled by 
default. I agree it should be safe to read the total length in one go.

----------
nosy: +martin.panter

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

Reply via email to