cpython/Misc/NEWS.d/next/Library/2024-02-28-10-41-24.gh-issue-115961.P-_DU0.rst
Serhiy Storchaka 51ef89cd9a
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'.
2024-04-21 11:46:39 +03:00

7 lines
462 B
ReStructuredText

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`. 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'``.