[ python-Bugs-1719898 ] tarfile stops expanding with long filenames

SourceForge.net noreply at sourceforge.net
Fri May 25 13:15:40 CEST 2007


Bugs item #1719898, was opened at 2007-05-16 09:32
Message generated for change (Comment added) made by zagy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1719898&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christian Zagrodnick (zagy)
Assigned to: Lars Gustäbel (gustaebel)
Summary: tarfile stops expanding with long filenames

Initial Comment:
The tarfile module fixes an issue with "Some old tar programs represent a directory as a regular file with a trailing slash.":

    if tarinfo.isreg() and tarinfo.name.endswith("/"):
        tarinfo.type = DIRTYPE

*After* that the full filename is composed. The chars >100 are stored in "prefix":

    if tarinfo.type != GNUTYPE_SPARSE:
        tarinfo.name normpath(os.path.join(nts(tarinfo.prefix), tarinfo.name))


So guess what happens if you filename has a / at the 100th character. Right, its considered a directory. Since directories have no data, the next metadata block is read from your file data which fails in various ways.

Patch attached.

----------------------------------------------------------------------

>Comment By: Christian Zagrodnick (zagy)
Date: 2007-05-25 11:15

Message:
Logged In: YES 
user_id=24696
Originator: YES

Ok, from looking at the code it should work in Python 2.5. I shipped
around the  Python 2.4 bug by creating a zip release instead of tar. 

Pity that Python 2.4 is no longer maintained though. I guess we need to
bump Zope 3 pretty soon then :)

----------------------------------------------------------------------

Comment By: Lars Gustäbel (gustaebel)
Date: 2007-05-16 13:32

Message:
Logged In: YES 
user_id=642936
Originator: NO

Did you also test Python 2.5? If this error occurs with that version too
(which it should not), please attach a small test tar archive to this
tracker item.

Python 2.4 is no longer maintained, sorry.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1719898&group_id=5470


More information about the Python-bugs-list mailing list