Skip to content

Conversation

@Rogdham
Copy link
Contributor

@Rogdham Rogdham commented Dec 13, 2025

For Python versions before 3.14, the Zstandard support is currently provided by the zstandard library (#1874). The API of zstandard is different from the one in the standard library (compression.zstd), which results in needing to implement an equivalent to ZstdFile.

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

I am conditioning the import based on the Python version instead of catching ImportError so that it will be picked up by linting tools (e.g. ruff) when you stop supporting 3.13. I also find it more readable.

Side note: if you are interested, the backport also provides support for Zstandard in tarfile and zipfile modules (just like Python 3.14+ does). This could help with issues such as #1589.

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.

@martindurant martindurant merged commit bedd23d into fsspec:master Dec 17, 2025
10 checks passed
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.

2 participants