[issue27590] tarfile module next() method hides exceptions

2016-07-27 Thread Lars Gustäbel
Lars Gustäbel added the comment: After all these years, it is not that easy to say why the decision to swallow this exception was made. One part surely was a lack of experience with the tar format itself and all of its implementations. The other part I guess was that it was supposed to avoid

[issue13477] tarfile module should have a command line

2013-03-20 Thread Lars Gustäbel
Lars Gustäbel added the comment: I'd like to re-emphasize that it is best to keep the whole thing as simple and straight-forward as possible. Offer some basic operations and that's it. Although I am pretty accustomed to the original tar command line, I think we should copy zipfile&#

[issue23193] Please support "numeric_owner" in tarfile

2015-01-13 Thread Lars Gustäbel
Lars Gustäbel added the comment: I would argue that a serious alternative to this patch is to simply override the TarFile.chown() method in a subclass. However, I'm not sure if this expects too much of the user. -- ___ Python tracker

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: I have written a test for the issue, so that we have a basis for discussion. There are four different scenarios where an unexpected eof can occur: inside a metadata block, directly after a metadata block, inside a data segment or directly after a data segment

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-28 Thread Lars Gustäbel
Lars Gustäbel added the comment: @Martin: Yes, that's right, but only for cases where the TarFile.fileobj attribute is an actual file object. But, most of the time it is something special, e.g. GzipFile or sys.stdin, which makes random seeking either impossible or perform very badly.

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-29 Thread Lars Gustäbel
Changes by Lars Gustäbel : Added file: http://bugs.python.org/file39544/issue24259-2.x.diff ___ Python tracker <http://bugs.python.org/issue24259> ___ ___ Python-bug

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-29 Thread Lars Gustäbel
Lars Gustäbel added the comment: @Thomas: I think your proposal adds a little too much complexity. Also, ExFileObject is not used during iteration, and we would like to detect broken archives without unpacking all the data segments first. I have written patches for Python 2 and 3

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-31 Thread Lars Gustäbel
Lars Gustäbel added the comment: @Martin: This is actually a nice idea that I hadn't thought of. I updated the Python 3 patch to use a seek() that moves to one byte before the next header block, reads the remaining byte and raises an error if it hits eof. The code looks rather clean com

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-05-31 Thread Lars Gustäbel
Changes by Lars Gustäbel : Added file: http://bugs.python.org/file39580/issue24259-2.x-2.diff ___ Python tracker <http://bugs.python.org/issue24259> ___ ___ Python-bug

[issue24465] Make tarfile have deterministic sorting

2015-06-18 Thread Lars Gustäbel
Lars Gustäbel added the comment: You don't need to patch the tarfile module. You could use os.walk() in shutil._make_tarball() and add each file with TarFile.add(recursive=False). -- nosy: +lars.gustaebel ___ Python tracker <http://bugs.py

[issue24465] Make tarfile have deterministic sorting

2015-06-19 Thread Lars Gustäbel
Lars Gustäbel added the comment: The patch would change behaviour for all tarfile users by the back door, that's why I am a little reluctant. And if the same can be achieved by a reasonably simple change to shutil I think it's ju

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-06-26 Thread Lars Gustäbel
Lars Gustäbel added the comment: The problem is that the tar archive has empty uid and gid fields, i.e. 7 spaces terminated with a null-byte. I attached a patch that solves the problem. -- keywords: +patch Added file: http://bugs.python.org/file39815/issue24514.diff

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-06-26 Thread Lars Gustäbel
Lars Gustäbel added the comment: You're welcome :-D -- assignee: -> lars.gustaebel priority: normal -> low stage: -> patch review type: -> behavior versions: +Python 3.5, Python 3.6 ___ Python tracker <http://bugs.p

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-06-26 Thread Lars Gustäbel
Lars Gustäbel added the comment: Yes, Python 2.7 still gets bugfixes. However, there's still some work to do on the patch (maybe clean the code, write a test, add a NEWS entry). -- ___ Python tracker <http://bugs.python.org/is

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-06-29 Thread Lars Gustäbel
Lars Gustäbel added the comment: I think a simple addition to the existing unittest for nti() will be enough. itn() seems well-tested, and nts() and stn() are not affected, because they don't operate on numbers. -- Added file: http://bugs.python.org/file39832/issue24514

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-06-29 Thread Lars Gustäbel
Lars Gustäbel added the comment: Martin, I followed your suggestion to raise ReadError. This needed an additional change in copyfileobj() because it is used both for adding file data to an archive and extracting file data from an archive. But I think the patch is in good shape now

[issue24514] tarfile fails to extract archive (handled fine by gnu tar and bsdtar)

2015-07-02 Thread Lars Gustäbel
Changes by Lars Gustäbel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue24259] tar.extractall() does not recognize unexpected EOF

2015-07-06 Thread Lars Gustäbel
Changes by Lars Gustäbel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue24838] tarfile.py: fix GNU and USTAR formats to properly handle paths with special characters that are encoded with more than one byte each

2015-08-14 Thread Lars Gustäbel
Lars Gustäbel added the comment: Thanks for the detailed report and the patch. I haven't checked yet, but I suppose that the entire 3.x branch is affected. The first thing I have to do now is to come up with a comprehensive testcase. -- assignee: -> lars.gustaebel co

[issue24838] tarfile.py: fix GNU and USTAR formats to properly handle paths with special characters that are encoded with more than one byte each

2016-04-18 Thread Lars Gustäbel
Changes by Lars Gustäbel : -- resolution: -> fixed stage: test needed -> resolved status: open -> closed versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.or

[issue10261] tarfile iterator without members caching

2016-04-19 Thread Lars Gustäbel
Lars Gustäbel added the comment: Closing after six years of inactivity. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue24838] tarfile.py: fix GNU and USTAR formats to properly handle paths with special characters that are encoded with more than one byte each

2016-04-19 Thread Lars Gustäbel
Lars Gustäbel added the comment: Sorry for the glitch, I suppose everything works fine now. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issu

[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2016-04-20 Thread Lars Gustäbel
Lars Gustäbel added the comment: Closed after years of inactivity. -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.o

[issue26877] tarfile use wrong code when read from fileobj

2016-04-30 Thread Lars Gustäbel
Lars Gustäbel added the comment: Please give us some example test code that shows us what goes wrong exactly. -- ___ Python tracker <http://bugs.python.org/issue26

[issue23228] The tarfile module crashes when tarfile contains a symlink and unpack directory contain it too

2016-05-08 Thread Lars Gustäbel
Lars Gustäbel added the comment: TarFile.makelink() has a fallback mode in case the platform does not support links. Instead of a symlink or a hardlink it extracts the file it points to as long as it exists in the current archive. More precisely, makelink() calls os.symlink() and if one of

[issue23228] The tarfile module crashes when tarfile contains a symlink and unpack directory contain it too

2016-05-08 Thread Lars Gustäbel
Lars Gustäbel added the comment: I suck :-) It is hg revision bb94f6222fef. -- ___ Python tracker <http://bugs.python.org/issue23228> ___ ___ Python-bugs-list m

[issue23649] tarfile not re-entrant for multi-threading

2015-03-16 Thread Lars Gustäbel
Lars Gustäbel added the comment: I agree with David that there is no need for tarfile to be thread-safe. There is nothing to be gained from distributing one TarFile object among multiple threads because it operates on a single resource which has to be accessed sequentially anyway. So, it

<    1   2   3