Repository navigation
Conversation
Documentation build overview
39 files changed ·
|
This comment was marked as outdated.
This comment was marked as outdated.
| This module does not handle multipart ZIP files. | ||
| It can handle ZIP files that use the ZIP64 extensions | ||
| (that is ZIP files that are more than 4 GiB in size). It supports | ||
| (mostly for ZIP files larger than 4 GiB). It supports |
There was a problem hiding this comment.
This should be 2 GiB, no? I suggest we drop it (as discussed in the issue).
There was a problem hiding this comment.
It is 4 GiB.
As discussed in the issue, the official hard limit for a local file for Zip64 is 4 GiB. I use "mostly" rather than "that is" because there are still other less common cases, such as > 65535 members, but it would be too verbose to mention all of them here.
| If *allowZip64* is ``True`` (the default), ZIP64 extensions will be used | ||
| on demand when the archive is written, such as when the total archive or an | ||
| individual member is larger than 2 GiB (for compatibility with legacy tools | ||
| even though the official hard limit is 4 GiB), or when there are more than | ||
| 65535 members in the archive. If it is ``False``, an exception will be | ||
| raised instead. |
There was a problem hiding this comment.
| If *allowZip64* is ``True`` (the default), ZIP64 extensions will be used | |
| on demand when the archive is written, such as when the total archive or an | |
| individual member is larger than 2 GiB (for compatibility with legacy tools | |
| even though the official hard limit is 4 GiB), or when there are more than | |
| 65535 members in the archive. If it is ``False``, an exception will be | |
| raised instead. | |
| If *allowZip64* is ``True`` (the default), ZIP64 extensions are used when | |
| needed, such as when a member or the archive reaches 2 GiB or the archive | |
| has more than 65535 members. If it is ``False``, :exc:`LargeZipFile` is | |
| raised instead. When writing a member with :meth:`open`, pass | |
| *force_zip64* if it may reach 2 GiB. |
I suggest a few little changes, dropping unnecessary details, clarifying the exception, and noting what happens with open.
There was a problem hiding this comment.
I would argue that "2 GiB threshold is for compatibility rather than official hard limit" is NOT an unnecessary detail. The developer may be confused and the current threshold may be suspected to be incorrectly assigned if this is not explicitly documented.
The details about open is unnecessary since it's already clearly described at ZipFile.open.
Clarify the behavior of the
allowZip64parameter, including the actual threshold for writing, and other cases like total file number and comment size.