Martin Panter added the comment:

Here is a patch for the higher-level LZMAFile implementation to use Nikolaus’s 
“max_length” parameter. It depends on Nikolaus’s patch also being applied.

I split out a _RawReader class that does the actual decompress() calls, and 
then wrapped that in a BufferedReader. This avoids needing any special code to 
implement buffering, readline(), etc. The only significant changes in the API 
that I can see are:

* LZMAFile now inherits the useless specification of BufferedReader.peek(), 
losing the guarantee of returning at least a single byte. I questioned the 
BufferedReader specification at <https://bugs.python.org/issue5811#msg233750>.
* read() now accepts size=None, because BufferedReader does. I had to change a 
test case for this.

----------
Added file: http://bugs.python.org/file37658/LZMAFile.patch

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

Reply via email to