summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-10 06:45:53 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-10 06:45:53 (GMT)
commit832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 (patch)
tree8fa7e8aae8445c058cc8fa1e8408fb9502c1a15e /Lib/tarfile.py
parent22ef9f722e6aa138d047625dd845c9a101c4454d (diff)
downloadcpython-832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08.zip
cpython-832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08.tar.gz
cpython-832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08.tar.bz2
Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-xLib/tarfile.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 9e291c2..37e4dcd 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2491,16 +2491,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