mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
This commit is contained in:
commit
4bdcfce512
3 changed files with 26 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue