[issue4750] tarfile keeps excessive dir structure in compressed files
Lars Gustäbel l...@gustaebel.de added the comment: The latest patch (4750.gzip.basename.fix.diff) cannot be used the way it is. The problem is that it uses the name attribute to store the basename with the .gz extension stripped. This breaks compatibility. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Lars Gustäbel l...@gustaebel.de added the comment: I fixed it in r75935 and r75937. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Tarek Ziadé ziade.ta...@gmail.com added the comment: Lars, is this still accurate ? -- nosy: +tarek versions: +Python 3.1, Python 3.2 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- components: -Distutils ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Changes by Martin v. Löwis mar...@v.loewis.de: Removed file: http://bugs.python.org/file12452/tarfile.directory.fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Martin v. Löwis mar...@v.loewis.de added the comment: No further bug fixes are accepted for 2.5 (unless they fix security problems), so I reject the 2.5 patch. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
anatoly techtonik techto...@gmail.com added the comment: For MSYS gzip added a bugreport here: https://sourceforge.net/tracker2/index.php?func=detailaid=2474481group_id=2435atid=102435 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
anatoly techtonik techto...@gmail.com added the comment: I attach patch for Python 2.6 gzip I clarified the meaning of self.name to be the basename corresponding to FNAME field in GZIP file header. There is a trace of deprecated gzip.filename API - I haven't found any references to it in documentation, so I removed it. In Python 2.5 it seemed to mean just filename in read mode and filename + .gz in write mode even if opened filename did not end with .gz If FNAME field from gzip header is ignored in read mode, so we want to make self.filename or self.name available via API - we need to agree what it should be - basename of archived file or path filename of archive itself. Added file: http://bugs.python.org/file12487/4750.gzip.basename.fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
anatoly techtonik techto...@gmail.com added the comment: I attach for Python 2.5 as well. People will use gzip module for a long time to build packages and patch will help them to get correct archives. Added file: http://bugs.python.org/file12490/python25.issue4750.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
anatoly techtonik techto...@gmail.com added the comment: 7zip can decompress both, but it still creates dist/ directory when decompressing file that is made with Python. I've noticed this bug with extra path component is actual with tar + gzip under windows. If they are executed separately and windows path with backslashes is used - directory prefix is not stripped. I.e. this creates archive with invalid header: {{{ tar -cf dist\create_tar_sep.tar package gzip -f9 dist\create_tar_sep.tar }}} This command is ok: {{{ tar -cf dist\create_tar_sep.tar package gzip -f9 dist/create_tar_sep.tar }}} ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Martin v. Löwis mar...@v.loewis.de added the comment: Lars, what do you think? -- assignee: - lars.gustaebel nosy: +lars.gustaebel, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Lars Gustäbel l...@gustaebel.de added the comment: Anatoly is right, the gzip file format specification (RFC 1952) says that the FNAME header field must be the basename of the original filename. So, this behaviour is not tarfile's fault but that of the gzip module and should be fixed there. 7zip can still decompress these files, right? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
New submission from anatoly techtonik techto...@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 TimeAttr 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 rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4750] tarfile keeps excessive dir structure in compressed files
Changes by anatoly techtonik techto...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file12452/tarfile.directory.fix.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com