compression: empty input marks BZ2/LZMA decompressors as EOF · Issue #8637 · RustPython/RustPython · GitHub
Skip to content

compression: empty input marks BZ2/LZMA decompressors as EOF #8637

Description

@doma17

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions