Uh oh!
There was an error while loading. Please reload this page.
gh-51067: Remove trailing space in _Repacker.repack() error message - #152138
gh-51067: Remove trailing space in _Repacker.repack() error message#152138danny0838 wants to merge 1 commit into
_Repacker.repack() error message#152138Conversation
…essage Remove an accidental trailing space inside the `BadZipFile` exception string literal to ensure clean exception messages.
StanFromIreland
commented
Jun 25, 2026
In the future, it's fine to bundle several small clean-ups (like the de-deduplication) in one PR. |
danny0838
commented
Jul 13, 2026
@StanFromIreland@gpshead Is there still any major concern about this PR? FYI, this error was introduced because I forgot to remove the trailing space when copying the code snippet from the zip bomb check: if (zinfo._end_offsetisnotNoneandzef_file.tell() +zinfo.compress_size>zinfo._end_offset):
ifzinfo._end_offset==zinfo.header_offset:
importwarningswarnings.warn(
f"Overlapped entries: {zinfo.orig_filename!r} "f"(possible zip bomb)",
skip_file_prefixes=(os.path.dirname(__file__),))
else:
raiseBadZipFile(
f"Overlapped entries: {zinfo.orig_filename!r} "f"(possible zip bomb)")I removed the "(possible zip bomb)" because it's irrelevant and may be improper here. The overlapping check here is against all ZipInfos in the ZipFile PLUS all ZipInfos passed by the For example, when calling For another example, when calling We do can consider providing a more comprehensive hint, such as the offset or used size of the offensive member, but it may need much more considerations and I think we can do the clean first and left it to future enhancement. |
Remove an accidental trailing space inside the
BadZipFileexception string literal to ensure clean exception messages.