Roundup Robot added the comment:
New changeset 301d7efac3de by Lars Gustäbel in branch '2.7':
Issue #24514: tarfile now tolerates number fields consisting of only whitespace.
https://hg.python.org/cpython/rev/301d7efac3de
New changeset 140b4b7b84bd by Lars Gustäbel in branch '3.4':
Issue
Changes by Lars Gustäbel l...@gustaebel.de:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24514
___
Tal Einat added the comment:
The patch is very simple, but this needs tests. At the very least, a simple tar
file which reproduces this issue could be added to the tests.
Taking this a step further would be writing some unit tests for the internal
nti() and itn() functions, and perhaps also
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.diff
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
Philippe added the comment:
lars: you are my hero! you rock. I picture you being able to read through tar
binary headers while you sleep. I am in awe.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24514
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 rep...@bugs.python.org
Philippe added the comment:
I verified that the patch issue24514.diff (adding .rstrip() ) works also on
Python 2.7. I verified it also works on Python 3.4
I ran it on 2.7 against a fairly large test suite of tar files without problems.
This is a +1 for me.
Lars: Do you think you could apply
Philippe added the comment:
Note: the traceback above are from calling taropen on the gunzipped tar.gz
The error are similar but a tar less informative when using the tgz and open.
--
___
Python tracker rep...@bugs.python.org
New submission from Philippe:
The extraction fails when calling tarfile.open using this archive:
http://archive.apache.org/dist/commons/logging/source/commons-logging-1.1.2-src.tar.gz
After some investigation, the file can be extracted with gnu tar and bsdtar and
the gzip compression is not
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 rep...@bugs.python.org
11 matches
Mail list logo