[issue19051] Unify buffered readers

2015-04-18 Thread Martin Panter
Martin Panter added the comment: The LZMA, gzip and bzip modules now all use BufferedReader, so Serhiy’s patch is no longer relevant for them. Serhiy’s patch also changed the zipfile module, which may be still relevant. On the other hand, perhaps it would be more ideal to use BufferedReader fo

[issue19051] Unify buffered readers

2015-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is it still relevant, now that #23529 has been committed? -- ___ Python tracker ___ ___ Python-bugs-

[issue19051] Unify buffered readers

2015-01-10 Thread Martin Panter
Martin Panter added the comment: Parts of the patch here actually do the same thing as my LZMAFile patch for Issue 15955. I wish I had looked at the patch earlier! The difference is I used a proposed max_length parameter for the decompressor rather than unlimited decompression, and I used the

[issue19051] Unify buffered readers

2015-01-09 Thread Martin Panter
Martin Panter added the comment: For what it’s worth, it would be better if compressed streams did limit the amount of data they decompressed, so that they are not susceptible to decompression bombs; see Issue 15955. But having a flexible-sized buffer could be useful in other cases. I haven’t

[issue19051] Unify buffered readers

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue19051] Unify buffered readers

2013-09-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: If you want this, I think it should be somehow folded into existing classes (for example BufferedIOBase). Yet another implementation of readline() isn't really a good idea. -- ___ Python tracker

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- Removed message: http://bugs.python.org/msg198083 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This primitive doesn't not well fit a case of compressed streams. A chunk of compressed data read from underlied file object can be uncompressed to unpredictable large data. We can't limit the size of buffer. Another point is that buffer interface is not ver

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This primitive doesn't not well fit a case of compressed streams. A chunk of compressed data read from underlied file object can be uncompressed to unpredictable large data. We can't limit the size of buffer. Another point is that buffer interface is not ver

[issue19051] Unify buffered readers

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: See issue12053 for a more flexible primitive. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file31817/read_bench_cmp ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are benchmark script and its results. -- Added file: http://bugs.python.org/file31816/read_bench.py ___ Python tracker ___ __

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are some classes in gzip, bz2, lzma, and zipfile modules which implement buffered reader interface. They read chunks of data from underlied file object, decompress it, save in internal buffer, and provide common methods to read from this buffer. Main