-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-115961: Add name and mode attributes for compressed file-like objects #116036
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
gh-115961: Add name and mode attributes for compressed file-like objects #116036
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
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.
Looks good! Some changes are not backwards compatible, but every change is properly documented.
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.
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.
|
📚 Documentation preview 📚: https://cpython-previews--116036.org.readthedocs.build/