sergey-dryabzhinsky / python-zstd

Simple python bindings to Yann Collet ZSTD compression library
BSD 2-Clause "Simplified" License
165 stars 27 forks source link

Issues compressing an empty bytestring. #80

Closed nepeat closed 2 years ago

nepeat commented 2 years ago

I know this is silly but I cannot compress an empty byte string with this library.

Actual Output

>>> zstd.compress(b"")
b"\xe4As\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'str' object cannot be interpreted as an integer"
>>> zstd.compress(b"")
b"\xe4\x80s\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'ModuleSpec' object has no attribute '_initializ"

Expected Output

>>> zstd.compress(b"")
b"\xb5/\xfd$\x00\x01\x00\x00\x99\xe9\xd8Q"
nepeat commented 2 years ago

PR #81 has been cut to fix this.