Message176883
> # Using zlib's interface
> while not d.eof:
> compressed = d.unconsumed_tail or f.read(8192)
> if not compressed:
> raise ValueError('End-of-stream marker not found')
> output = d.decompress(compressed, 8192)
> # <process output>
This is not usable with bzip2. Bzip2 uses large block size and unconsumed_tail
can be non empty but decompress() will return b''. With zlib you possible can
see the same effect on some input when read by one byte.
> A related, but orthogonal proposal: We might want to make unconsumed_tail
> a memoryview (provided the input data is know to be immutable), to avoid
> creating an unnecessary copy of the data.
It looks interesting. However the data should be copied anyway if the input
data is not a bytes object. |
|
Date |
User |
Action |
Args |
2012-12-04 08:49:44 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, christian.heimes, nadeem.vawda, eric.araujo, Arfrever |
2012-12-04 08:49:43 | serhiy.storchaka | link | issue15955 messages |
2012-12-04 08:49:43 | serhiy.storchaka | create | |
|