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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompressobj does not support flush() #65

Closed
vnair81 opened this issue Nov 28, 2018 · 1 comment
Closed

decompressobj does not support flush() #65

vnair81 opened this issue Nov 28, 2018 · 1 comment

Comments

@vnair81
Copy link

vnair81 commented Nov 28, 2018

decompressobj which is provided as an API-compatible interface with zlib.decompressobj does not support flush().
This makes it difficult to be used alongside zlib decompressor.

@vnair81
Copy link
Author

vnair81 commented Feb 27, 2019

In release 0.11.0, although flush() is now supported on decompressobj, it returns None unlike zlib.decompressobj which returns empty string.

From the python documentation:

Decompress.flush([length])
All pending input is processed, and a string containing the remaining uncompressed output is returned. After calling flush(), the decompress() method cannot be called again; the only realistic action is to delete the object.

The optional parameter length sets the initial size of the output buffer.

This behavior makes special handling needed for zstandard decompressor when using the return value directly in things like file object's write(), which do not accept None.

Can we consider returning empty string instead?

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

No branches or pull requests

1 participant