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 /Lib/tarfile.py | |
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 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 78bb10c..5fc6183 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -636,6 +636,10 @@ class _FileInFile(object): def flush(self): pass + @property + def mode(self): + return 'rb' + def readable(self): return True |