diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-10 06:47:10 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-10 06:47:10 (GMT) |
commit | 4bdcfce5129fbf2d710046b4d3f9be636e9e0898 (patch) | |
tree | 4f4eb016460584352945779f7199fd68eb1728a2 /Lib/tarfile.py | |
parent | 5ef01e9b93493a1ca8746b956a70972ef52b3791 (diff) | |
parent | 832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 (diff) | |
download | cpython-4bdcfce5129fbf2d710046b4d3f9be636e9e0898.zip cpython-4bdcfce5129fbf2d710046b4d3f9be636e9e0898.tar.gz cpython-4bdcfce5129fbf2d710046b4d3f9be636e9e0898.tar.bz2 |
Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 4b4e0d3..06436eb 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -2494,16 +2494,16 @@ def main(): _, ext = os.path.splitext(tar_name) compressions = { # gz - 'gz': 'gz', - 'tgz': 'gz', + '.gz': 'gz', + '.tgz': 'gz', # xz - 'xz': 'xz', - 'txz': 'xz', + '.xz': 'xz', + '.txz': 'xz', # bz2 - 'bz2': 'bz2', - 'tbz': 'bz2', - 'tbz2': 'bz2', - 'tb2': 'bz2', + '.bz2': 'bz2', + '.tbz': 'bz2', + '.tbz2': 'bz2', + '.tb2': 'bz2', } tar_mode = 'w:' + compressions[ext] if ext in compressions else 'w' tar_files = args.create |