--- tarfile.py.orig 2007-05-16 10:40:28.000000000 +0200 +++ tarfile.py 2007-05-16 10:40:40.000000000 +0200 @@ -688,17 +688,17 @@ 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 if tarinfo.type != GNUTYPE_SPARSE: tarinfo.name = normpath(os.path.join(nts(tarinfo.prefix), tarinfo.name)) + # 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 + # Directory names should have a '/' at the end. if tarinfo.isdir(): tarinfo.name += "/"