Skip to content

Conversation

@Rogdham
Copy link
Contributor

@Rogdham Rogdham commented Oct 19, 2025

For Python versions before 3.14, the Zstandard support is currently provided by the zstandard library. The API of this library is different from the one in the standard library (compression.zstd), which results in two different implementations of the ZstdDecoder class.

This PR removes the zstdandard dependency in favor of the backport of compression.zstd.

Fixes #3693

Full disclosure: I'm the author and maintainer of backports.zstd, and the maintainer of pyzstd (which code was used as a base for the integration into Python). I also helped with PEP-784 and its integration into CPython.

@Rogdham Rogdham marked this pull request as ready for review October 19, 2025 09:14
pquentin
pquentin previously approved these changes Oct 20, 2025
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

(wow, we repeat a lot of that zstd detection code, maybe this should be refactored in a follow-up PR)

@@ -1,5 +1,5 @@
version = 1
revision = 3
revision = 2
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to update your uv version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm maybe I am doing something wrong, but running uv lock does not make any further changes.

I have updated uv to 0.9.4, which should be the latest version, and still the same.

Feel free to fix if you know how!

Copy link
Member

@illia-v illia-v left a comment

Choose a reason for hiding this comment

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

Thanks for creating the package and this pull request!

@pquentin pquentin enabled auto-merge (squash) October 28, 2025 10:03
@pquentin pquentin merged commit 93e6ae2 into urllib3:main Oct 28, 2025
39 checks passed
@Rogdham Rogdham deleted the backports.zstd branch October 28, 2025 12:54
@typenoob typenoob mentioned this pull request Nov 5, 2025
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.

Consider switching from zstandard to backports.zstd

3 participants