-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
gh-139821: Make tarfile.open correctly forward keyword arguments for zstd in stream mode.
#139822
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
base: main
Are you sure you want to change the base?
Conversation
tarfile.open correctly forward keyword arguments for zstd in stream mode.
Lib/tarfile.py
Outdated
| def __init__(self, name, mode, comptype, fileobj, bufsize, | ||
| compresslevel, preset): | ||
| compresslevel, preset, level, options, zstd_dict): |
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.
I think it would be cleaner at this point to take **kwargs in _Stream and pop items per-(de)compressor. Having stream take every possible argument doesn't seem like a great idea for readability purposes since many of the arguments will be unused. I believe because this was up in the air and also how to treat compressLevel vs level, we intentionally didn't include this in 3.14 before the beta cutoff.
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.
Oh, I see. Thanks for the explanation.
I'll rewrite it.
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.
The new revision looks a lot better, thank you! I would also suggest using .get so that if the keywords are not passed then we don't get key errors and instead use fallbacks.
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.
OK.
tarfile.open()does not forward keyword arguments to the underlying_Streamobject for zstd in stream mode #139821📚 Documentation preview 📚: https://cpython-previews--139822.org.readthedocs.build/