python-zstandard
python-zstandard copied to clipboard
Fix assertion failure when calling decompress multiple times
- Add a test that emulates the calling pattern in https://github.com/apache/beam/issues/22939
- Address the assertion failure by checking size of
unused_data
(please advise if there's a better solution here)
It looks like I also need to turn off NDBEUG to keep the assert from being compiled out. We do this in internal tests, I'm not sure how to change it for this build system.
Adding undef_macros = ["NDEBUG"]
here does it: https://github.com/indygreg/python-zstandard/blob/6006fdf164ac0e89b260706a3e4ef5806aceffb6/setup_zstd.py#L114
But that will add it in releases as well.
Thanks, @TheNeuralBit! I am also interested in this fix.
@indygreg, would it be possible to trigger the GitHub actions workflows so that we can see if there are any issues with this PR? Thank you!