Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flush method to LZ4FrameFile #245

Merged
merged 5 commits into from May 21, 2022

Conversation

pedrovhb
Copy link
Contributor

Hello! First off, thanks for the library, it's been quite handy 馃檪

The LZ4FrameFile abstraction is somewhat leaky/surprising in that it offers a flush method, as expected of a file, but it doesn't actually flush compressed data as one may expect. The method is just inherited from io.BufferedIOBase and doesn't have special logic to handle LZ4.

This PR introduces the missing logic so that calling flush correctly ensures the frame is completed and flushed to the underlying fp.

I'm not particularly familiar with the concepts behind compression algorithms, so while this really just deals with the file interface, works on the cases I've tried, and passes tests, please do look at it critically and let me know if I missed something!

@jonathanunderwood jonathanunderwood merged commit d739986 into python-lz4:master May 21, 2022
@jonathanunderwood
Copy link
Member

Thanks for this, I really appreciate the time you spent on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants