Skip to content

gh-132983: Fix small issues with zstd support in zipfile #133723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pR0Ps
Copy link
Contributor

@pR0Ps pR0Ps commented May 9, 2025

Some small tweaks to the zipfile zstd support added in #133365

  • Add ZIP_ZSTANDARD constant to the module's __all__
  • Add zstd notes to the ZipFile's docstring.
  • Add a missing check for min_level in _write_end_record
  • Pass through the specified compresslevel into the ZstdCompressor and document it.

Note: I didn't create an issue because this all seems fairly trivial, but I can if needed.

CC: @emmatyping @gpshead

Copy link
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

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

Thanks, these changes look good! I had a few minor suggestions. I think we should be careful how we document the accepted values for zstd's compression level. I don't think we can or should hardcode the values, but I also think giving a pointer to where the current values can be found would be useful.

@emmatyping emmatyping changed the title Fix small issues with zstd support in zipfile May 9, 2025
@AA-Turner AA-Turner added the needs backport to 3.14 bugs and security fixes label May 9, 2025
Co-authored-by: Emma Smith <emma@emmatyping.dev>
@pR0Ps
Copy link
Contributor Author

pR0Ps commented May 10, 2025

All requested changes applied. I see a test failed, but as far as I can tell it's not related to the changes in this PR.

@hugovk hugovk changed the title GH-132983: Fix small issues with zstd support in zipfile May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants