Martin Panter added the comment:

I am posting LZMAFile-etc.v3.patch, where I have implemented a “buffer_size” 
parameter to the buffered LZMAFile etc classes. I have not implemented 
open(buffering=...) for the time being (which should probably delegate to the 
buffer_size parameter or return a raw _DecompressReader object, at least for 
read mode). Other changes:

* Restored the _MODE_WRITE = 3 value
* Explained the _pos and _size attributes in _DecompressReader
* Factored out decomp_factory and args, decomp_error parameters to make 
_DecompressReader generic
* BZ2File modified similarly to LZMAFile
* I removed the deprecated and unused BZ2File(buffering=...) parameter; 
buffer_size takes its place. The old buffering parameter appears to have been 
documented, but never implemented in C Python, so hopefully this is not a big 
deal.

Still to do: Need to find a better home for the _DecompressReader and 
_BaseStream classes. Currently it lives in “lzma”, but apparently it is 
possible for any of the gzip, bz2, lzma modules to not be importable, so it 
would have to live elsewhere. Possible options are the io module, or a brand 
new internal module (e.g. Lib/_compression.py). Thoughts?

Also I am about to see if I can make GzipFile use the _DecompressReader class. 
I will have to add GzipFile(buffer_size=...) as a keyword-only parameter since 
the third parameter position is already taken. There are quite a few quirks 
with gzip and zlib compared to bz2 and lzma, so I will see how I go.

----------
Added file: http://bugs.python.org/file38367/LZMAFile-etc.v3.patch

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

Reply via email to