[issue44067] Zipfile lib overwrites the extra field during closing when the archive size is more then ZIP64_LIMIT

2021-11-06 Thread anadius
Change by anadius : -- nosy: +alanmcintyre, serhiy.storchaka, twouters ___ Python tracker <https://bugs.python.org/issue44067> ___ ___ Python-bugs-list mailin

[issue44067] Zipfile lib overwrites the extra field during closing when the archive size is more then ZIP64_LIMIT

2021-11-04 Thread anadius
anadius added the comment: I was looking at `zipfile._strip_extra` trying to figure out how it works. It doesn't. It skips extra headers after the last one that matches. That's what causes this issue. Here's a fixed version: def _strip_extra(extra, xids): # Remove Extra Fields