Skip to content

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

Closed

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

  1. hyoinandout commented on Sep 20, 2026

    @hyoinandout
    Contributor

    take

  2. added a commit that references this issue on Sep 20, 2026
    4c7cc0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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