Danny Yoo added the comment:
Unfortunately, fixing just zlib.crc32 isn't quite enough for our purposes. We
still will see OverflowErrow in zipfile if compression is selected.
Demonstration code:
import zipfile
## Possible workaround: monkey-patch
Gregory P. Smith added the comment:
This bug prevents zipfile's writestr() from writing large data (longer than
UINT_MAX) to a 64-bit zip file.
The zlib.crc32 function which, as written, cannot accept input with a size
larger than an unsigned int.
https://hg.python.org/cpython/file/94ec4d8cf1
New submission from Danny Yoo:
Reproduction steps:
---
$ python2.7 -c "import zlib;zlib.crc32('a'*(1<<31))"
Traceback (most recent call last):
File "", line 1, in
OverflowError: size does not fit in an int
---
We ran into this bug in zlib.crc32 when using zipfile.writestr() with a very
larg