gh-133005: Support tarfile.open(mode="w|xz", preset=...)#133007
Merged
gpshead merged 4 commits intopython:mainfrom Apr 27, 2025
Merged
gh-133005: Support tarfile.open(mode="w|xz", preset=...)#133007gpshead merged 4 commits intopython:mainfrom
tarfile.open(mode="w|xz", preset=...)#133007gpshead merged 4 commits intopython:mainfrom
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.
Contributor
Author
|
I've added raising an exception if |
Contributor
Author
|
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>
Contributor
Author
|
Thank you for your suggestions! |
gpshead
approved these changes
Apr 27, 2025
Member
gpshead
left a comment
There was a problem hiding this comment.
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)
gpshead
approved these changes
Apr 27, 2025
Contributor
Author
|
Thank you! It was also my logic that it's better to add the error while we're still in alpha. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support passing the
presetoption totarfile.openwhen the file is open withmode="w|xz". This aligns the behavior with"w:xz"mode.presetargument totarfile.open(mode="w|xz")#133005📚 Documentation preview 📚: https://cpython-previews--133007.org.readthedocs.build/