diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-04-21 08:46:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-21 08:46:39 (GMT) |
commit | 51ef89cd9acbfbfa7fd8d82f0c6baa388bb650c9 (patch) | |
tree | eb6f52baa37360fb86c7401d12c47f51ad3795af /Doc/whatsnew | |
parent | ccda73828473576c57d1bb31774f56542d6e8964 (diff) | |
download | cpython-51ef89cd9acbfbfa7fd8d82f0c6baa388bb650c9.zip cpython-51ef89cd9acbfbfa7fd8d82f0c6baa388bb650c9.tar.gz cpython-51ef89cd9acbfbfa7fd8d82f0c6baa388bb650c9.tar.bz2 |
gh-115961: Add name and mode attributes for compressed file-like objects (GH-116036)
* 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'.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.13.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 0f0fca5..5be5620 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -206,6 +206,11 @@ Other Language Changes (Contributed by Victor Stinner in :gh:`114570`.) +* Added :attr:`!name` and :attr:`!mode` attributes for compressed + and archived file-like objects in modules :mod:`bz2`, :mod:`lzma`, + :mod:`tarfile` and :mod:`zipfile`. + (Contributed by Serhiy Storchaka in :gh:`115961`.) + * Allow controlling Expat >=2.6.0 reparse deferral (:cve:`2023-52425`) by adding five new methods: @@ -1605,6 +1610,12 @@ Changes in the Python API than directories only. Users may add a trailing slash to match only directories. +* The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` was + changed from integer (``1`` or ``2``) to string (``'rb'`` or ``'wb'``). + The value of the :attr:`!mode` attribute of the readable file-like object + returned by :meth:`zipfile.ZipFile.open` was changed from ``'r'`` to ``'rb'``. + (Contributed by Serhiy Storchaka in :gh:`115961`.) + * :c:func:`!PyCode_GetFirstFree` is an unstable API now and has been renamed to :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan Romanyuk in :gh:`115781`.) |