Message261698
| Author |
martin.panter |
| Recipients |
benjamin.peterson, martin.panter, pitrou, serhiy.storchaka, stutzbach |
| Date |
2016年03月13日.12:01:15 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1457870475.72.0.380033906207.issue23214@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Calling BufferedReader.read1(sys.maxsize) gives me a MemoryError. Making read1(-1) equivalent to read1(sys.maxsize) only makes sense where the return value already has a predetermined size, and only a limited buffer needs to be allocated.
Another interpretation is to return an arbitrary, modest buffer size. This is what I ended up doing with LZMAFile.read1() in Issue 23529: return no more than 8 KiB. It is not equivalent to sys.maxsize because more than 8 KiB is possible if you ask for it. HTTPResponse (for non-chunked responses) is similar, but uses a default of 16 KiB. |
|