Index: python/branches/release24-maint/Lib/tarfile.py =================================================================== --- python/branches/release24-maint/Lib/tarfile.py (revision 47051) +++ python/branches/release24-maint/Lib/tarfile.py (working copy) @@ -688,11 +688,6 @@ tarinfo.devmajor = tarinfo.devmajor = 0 tarinfo.prefix = buf[345:500] - # 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 - # The prefix field is used for filenames > 100 in # the POSIX standard. # name = prefix + '/' + name @@ -1628,6 +1623,11 @@ if tarinfo.type in self.TYPE_METH: return self.TYPE_METH[tarinfo.type](self, tarinfo) + # 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 + tarinfo.offset_data = self.offset if tarinfo.isreg() or tarinfo.type not in SUPPORTED_TYPES: # Skip the following data blocks.