[Python] `output_buffer_limit` is not fully respected
- Dominant language
- TypeScript
- Stars
- 14.9k
- Forks
- 1.4k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
Version 1.2.0 added `output_buffer_limit` – "If set, the output buffer will not grow once its size equal or exceeding that value."
While it does usually prevent decompressing the whole data at once, the output size is not limited by it.
```python
import brotli
compressed = brotli.compress(b"x" * (10 * 2**20)) # 10 MiB
decompressor = brotli.Decompressor()
print(len(decompressor.process(compressed, output_buffer_limit=2**20))) # Output 2_064_288, expected 1_048_576
print(len(decompressor.process(b"", output_buffer_limit=1024))) # Output 32_752, expected 1024
print(len(decompressor.process(b"", output_buffer_limit=32_753))) # Output 98_272, expected 32_753
```
Contributor guide
Assessment
This issue has not been assessed yet.