[New-bugs-announce] [issue4750] tarfile keeps excessive dir structure in compressed files

anatoly techtonik report at bugs.python.org
Fri Dec 26 14:19:59 CET 2008


New submission from anatoly techtonik <techtonik at gmail.com>:

When tarfile is directed to create tar.gz compressed archive file in a
path different from current, it saves full path information in .gz
header where only filename is required.

This causes problems with decompression utilities, such as 7zip. The
testsuite with patch are attached.

{{{
tar -czf dist\create_tar.tar.gz package
7z l dist\create_tar.tar.gz > tar.out
python test_create.tar.gz.py
7z l dist\create_py.tar.gz > py.out
diff -pu3 tar.out py.out
}}}

{{{
--- tar.out     Fri Dec 26 15:12:42 2008
+++ py.out      Fri Dec 26 15:12:42 2008
@@ -1,10 +1,10 @@

 7-Zip 4.57  Copyright (c) 1999-2007 Igor Pavlov  2007-12-06

-Listing archive: dist\create_tar.tar.gz
+Listing archive: dist\create_py.tar.gz

    Date      Time    Attr         Size   Compressed  Name
 ------------------- ----- ------------ ------------ 
------------------------
-2008-12-26 15:12:41              10240          170  create_tar.tar
+2008-12-26 15:03:39              10240          141  dist/create_py.tar
 ------------------- ----- ------------ ------------ 
------------------------
-                                 10240          170  1 files, 0 folders
+                                 10240          141  1 files, 0 folders
}}}

See also issue 1886 and msg61515 in particular

----------
components: Distutils, Library (Lib)
files: test_tarfile.extrapath.zip
messages: 78296
nosy: techtonik
severity: normal
status: open
title: tarfile keeps excessive dir structure in compressed files
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file12451/test_tarfile.extrapath.zip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4750>
_______________________________________


More information about the New-bugs-announce mailing list