python-hyper / brotlicffi

Python bindings to the Brotli compression library
MIT License
147 stars 27 forks source link

Compressor.flush does not work as documented #139

Closed roganov closed 3 years ago

roganov commented 6 years ago

Documentation says that Compressor.flush emits all remaining data, but in fact it does not. This fails

bc = brotli.Compressor()
assert bc.compress(b'Time to Relax!') + bc.flush() == brotli.compress(b'Time to Relax!')

This passes

bc = brotli.Compressor()
assert bc.compress(b'Time to Relax!') + bc.finish() == brotli.compress(b'Time to Relax!')
sethmlarson commented 3 years ago

Closing this as I believe it is solved in 1.0.9.x