gh-115961: Add name and mode attributes for compressed file-like objects#116036
Merged
serhiy-storchaka merged 4 commits intopython:mainfrom Apr 21, 2024
Merged
Conversation
…e objects
* Add name and mode attributes for compressed and archived file-like objects
in modules bz2, lzma, tarfile and zipfile.
* Change the value of the mode attribute of GzipFile from integer (1 or 2)
to string ('rb' or 'wb').
* Change the value of the mode attribute of ZipExtFile from 'r' to 'rb'.
223fd79 to
874c8eb
Compare
eendebakpt
approved these changes
Apr 20, 2024
Contributor
eendebakpt
left a comment
There was a problem hiding this comment.
Looks good! Some changes are not backwards compatible, but every change is properly documented.
gpshead
approved these changes
Apr 20, 2024
Member
gpshead
left a comment
There was a problem hiding this comment.
Nice. This is much more consistent across all our file like ducks.
I'm not worried about things like the old gzip 1 and 2 values as I don't expect anyone to ever have used them. Similar for the old 'r' that should've been a 'rb'.
If anything comes up depending on this during the betas we can revisit.
|
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.
📚 Documentation preview 📚: https://cpython-previews--116036.org.readthedocs.build/