Message46908
When a TarFile object reads a tar archive, it scans
through the headers, converts them into TarInfo objects
and adds them to the internal data structures:
self.members.append(tarinfo)
self.membernames.append(tarinfo.name)
When a GNU longname member is processed, it is added at
a point in time when its name attribute has not yet
been replaced with the longname, so longnames in
self.membernames are truncated and therefore unusable.
This problem could have been fixed with a quick/dirty
hack. But I decided to remove self.membernames
completely because it is redundant. getnames() which
was the public interface to it now generates a list
on-the-fly from the list of members, so it always
reflects the actual state.
I encountered another small bug on the way. The docs
for TarFile.getmember() state: "If a member occurs more
than once in the archive, its last occurence is assumed
to be the most up-to-date version."
It was never implemented like that, so I fixed it, too. |
|
Date |
User |
Action |
Args |
2007-08-23 15:39:52 | admin | link | issue1029061 messages |
2007-08-23 15:39:52 | admin | create | |
|