-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-133005: Support tarfile.open(mode="w|xz", preset=...)
#133007
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
Conversation
Support passing the `preset` option to `tarfile.open` when the file is open with `mode="w|xz"`. This aligns the behavior with `"w:xz"` mode.
697bbca
to
ebf37b6
Compare
Raise an error if `compresslevel` or `preset` argument is specified for stream mode with incorrect compression. This should reduce the risk of mistakes and align the stream modes with regular modes, that raise an implicit TypeError on unsupported arguments.
I've added raising an exception if |
The macOS failures don't seem related. |
Misc/NEWS.d/next/Library/2025-04-26-14-44-21.gh-issue-133005.y4SRfk.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Thank you for your suggestions! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the silently ignored when irrelevant compresslevel= that now raises causes an issue during the beta period we can revisit that error addition. (the error codepath will be adjusted with zstd support landing soon as well)
Thank you! It was also my logic that it's better to add the error while we're still in alpha. |
Support passing the
preset
option totarfile.open
when the file is open withmode="w|xz"
. This aligns the behavior with"w:xz"
mode.preset
argument totarfile.open(mode="w|xz")
#133005📚 Documentation preview 📚: https://cpython-previews--133007.org.readthedocs.build/