[issue21872] LZMA library sometimes fails to decompress a file

Jeffrey Kintscher report at bugs.python.org
Tue Jun 4 03:07:01 EDT 2019


Jeffrey Kintscher <websurfer at surf2c.net> added the comment:

I adapted the example in msg221784:


with open('22h_ticks_bad.bi5', 'rb') as f:
    infile = f.read()

for i in range(1, 9000):
    decompressor = _lzma.LZMADecompressor()
    first_out = decompressor.decompress(infile[:i])
    first_len = len(first_out)
    last_out = decompressor.decompress(infile[i:])
    last_len = len(last_out)
    if not decompressor.eof:
        print(i, first_len, first_len + last_len, decompressor.eof)


which outputs this using both 3.7.3 and 3.8.0a3+ on macOS 10.14.4:

648 2682 45479 False
1834 7442 45479 False
2766 11667 45473 False
2767 11668 45474 False
3591 15428 45473 False
5051 21743 45473 False
5052 21745 45475 False
5589 24387 45475 False
5590 24388 45476 False
6560 28823 45476 False
6561 28824 45477 False
7327 32325 45474 False
8192 36251 45473 False
8193 36253 45475 False
8368 37283 45475 False
8369 37285 45477 False

So, yes, still an active bug.

----------
versions: +Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21872>
_______________________________________


More information about the Python-bugs-list mailing list