Skip to content

Conversation

@illia-v
Copy link
Contributor

@illia-v illia-v commented Nov 1, 2025

Upgrade libbrotli to v1.2.0 which has a notable change for its Python library:

python: added Decompressor::can_accept_more_data method and optional
output_buffer_limit argument Decompressor::process;
that allows mitigation of unexpectedly large output;
reported by Charles Chan (https://github.com/charleswhchan)

Closes #208

@miurahr
Copy link

miurahr commented Nov 10, 2025

CI checks are failed because CI modernization #205 has never been merged.

Copy link
Contributor

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Saw one tiny bit where the upstream test is a little more rigorous and maybe you could adopt that.

@sethmlarson sethmlarson merged commit 75ac969 into python-hyper:main Nov 20, 2025
30 checks passed
illia-v added a commit to urllib3/urllib3 that referenced this pull request Dec 5, 2025
* Prevent decompression bomb for zstd in Python 3.14

* Add experimental `decompress_iter` for Brotli

* Update changes for Brotli

* Add `GzipDecoder.decompress_iter`

* Test python-hyper/brotlicffi#207

* Pin Brotli

* Add `decompress_iter` to all decoders and make tests pass

* Pin brotlicffi to an official release

* Revert changes to response.py

* Add `max_length` parameter to all `decompress` methods

* Fix the `test_brotlipy` session

* Unset `_data` on gzip error

* Add a test for memory usage

* Test more methods

* Fix the test for `stream`

* Cover more lines with tests

* Add more coverage

* Make `read1` a bit more efficient

* Fix PyPy tests for Brotli

* Revert an unnecessarily moved check

* Add some comments

* Leave just one `self._obj.decompress` call in `GzipDecoder`

* Refactor test params

* Test reads with all data already in the decompressor

* Prevent needless copying of data decoded with `max_length`

* Rename the changed test

* Note that responses of unknown length should be streamed too

* Add a changelog entry

* Avoid returning a memory view from `BytesQueueBuffer`

* Add one more note to the changelog entry
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

Successfully merging this pull request may close these issues.

Comatibility broken with [email protected]

4 participants