Summary
Calling decompress(b"") before compressed input marks BZ2Decompressor
and LZMADecompressor as finished.
Expected
Empty input should be a no-op. CPython keeps eof false and needs_input
true, then accepts compressed data supplied by a later call:
BZ2Decompressor False True
b'data'
LZMADecompressor False True
b'data'
Actual
RustPython marks both decompressors as finished and rejects a later input:
BZ2Decompressor True False
EOFError: End of stream already reached
LZMADecompressor True False
EOFError: End of stream already reached
Python Documentation
Summary
Calling
decompress(b"")before compressed input marksBZ2Decompressorand
LZMADecompressoras finished.Expected
Empty input should be a no-op. CPython keeps
eoffalse andneeds_inputtrue, then accepts compressed data supplied by a later call:
Actual
RustPython marks both decompressors as finished and rejects a later input:
Python Documentation