diff options
author | Victor Stinner <vstinner@python.org> | 2022-06-24 11:59:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 11:59:32 +0200 |
commit | d3a27e4c9339d787f2eb3e68fd3b12e303cb4a42 (patch) | |
tree | ea345636f50dc9dd7f2d4d343ba2c8c0874c248b /Lib | |
parent | d435a18c537a62a89a70005885e6e09f58997d8a (diff) | |
download | cpython-git-d3a27e4c9339d787f2eb3e68fd3b12e303cb4a42.tar.gz |
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')
-rw-r--r-- | Lib/gzip.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py index 5b20e5ba69..8edcda4493 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 |