summaryrefslogtreecommitdiffstats
path: root/Lib/gzip.py
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 /Lib/gzip.py
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 'Lib/gzip.py')
-rw-r--r--Lib/gzip.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py
index 5b20e5b..8edcda4 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -213,14 +213,6 @@ class GzipFile(_compression.BaseStream):
self._write_gzip_header(compresslevel)
@property
- def filename(self):
- import warnings
- warnings.warn("use the name attribute", DeprecationWarning, 2)
- if self.mode == WRITE and self.name[-3:] != ".gz":
- return self.name + ".gz"
- return self.name
-
- @property
def mtime(self):
"""Last modification time read from stream, or None"""
return self._buffer.raw._last_mtime