Skip to content

Allow 'compression' arg to zip converter to be passed in as a string - #151

Merged
tclose merged 1 commit into
mainfrom
string-zip-comp-arg
Sep 21, 2026
Merged

tclose merged 1 commit into
mainfrom
string-zip-comp-arg

Conversation

@tclose

@tclose tclose commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Allow compression arg to zip converter to be passed in as a string

create_zip's compression parameter previously only accepted the raw zipfile.ZIP_* int constants. This adds support for passing the constant name as a string (e.g. "ZIP_DEFLATED"), resolved via getattr(zipfile, ...), with a ValueError for unrecognised names. Adds roundtrip tests over all four compression strings plus an invalid-value test, and an inpt codespell ignore for the existing test fixture variable name.

@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tclose
tclose merged commit e02461c into main Sep 21, 2026
19 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.

1 participant