summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-24 09:59:32 (GMT)
committerGitHub <noreply@github.com>2022-06-24 09:59:32 (GMT)
commitd3a27e4c9339d787f2eb3e68fd3b12e303cb4a42 (patch)
treeea345636f50dc9dd7f2d4d343ba2c8c0874c248b /Doc
parentd435a18c537a62a89a70005885e6e09f58997d8a (diff)
downloadcpython-d3a27e4c9339d787f2eb3e68fd3b12e303cb4a42.zip
cpython-d3a27e4c9339d787f2eb3e68fd3b12e303cb4a42.tar.gz
cpython-d3a27e4c9339d787f2eb3e68fd3b12e303cb4a42.tar.bz2
gh-94196: Remove gzip.GzipFile.filename attribute (#94197)
gzip: Remove the filename attribute of gzip.GzipFile, deprecated since Python 2.6, use the name attribute instead. In write mode, the filename attribute added '.gz' file extension if it was not present.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/gzip.rst4
-rw-r--r--Doc/whatsnew/3.12.rst6
2 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 8cea264..1a2582d 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -165,6 +165,10 @@ The module defines the following items:
.. versionchanged:: 3.6
Accepts a :term:`path-like object`.
+ .. versionchanged:: 3.12
+ Remove the ``filename`` attribute, use the :attr:`~GzipFile.name`
+ attribute instead.
+
.. deprecated:: 3.9
Opening :class:`GzipFile` for writing without specifying the *mode*
argument is deprecated.
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index 8526a13..6257901 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -218,6 +218,12 @@ Removed
use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead.
(Contributed by Victor Stinner in :gh:`94199`.)
+* :mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`,
+ deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute
+ instead. In write mode, the ``filename`` attribute added ``'.gz'`` file
+ extension if it was not present.
+ (Contributed by Victor Stinner in :gh:`94196`.)
+
Porting to Python 3.12
======================