New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tarfile stops expanding with long filenames #44956
Comments
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. |
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. |
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 :) |
Okay, I close this bug then. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: