Message261698
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. |
|
Date |
User |
Action |
Args |
2016-03-13 12:01:15 | martin.panter | set | recipients:
+ martin.panter, pitrou, benjamin.peterson, stutzbach, serhiy.storchaka |
2016-03-13 12:01:15 | martin.panter | set | messageid: <1457870475.72.0.380033906207.issue23214@psf.upfronthosting.co.za> |
2016-03-13 12:01:15 | martin.panter | link | issue23214 messages |
2016-03-13 12:01:15 | martin.panter | create | |
|