Skip to content

gh-73199: Fix incorrect zip64 threshold in doc - #152472

Open
danny0838 wants to merge 3 commits into
python:mainfrom
danny0838:gh-73199
Open

danny0838 wants to merge 3 commits into
python:mainfrom
danny0838:gh-73199

Conversation

@danny0838

@danny0838 danny0838 commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Clarify the behavior of the allowZip64 parameter, including the actual threshold for writing, and other cases like total file number and comment size.

@read-the-docs-community

read-the-docs-community Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33435010 | 📁 Comparing aed82dc against main (95bfaff)

  🔍 Preview build  

39 files changed · ± 39 modified

± Modified

@github-actions

This comment was marked as outdated.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Oct 5, 2026
Comment thread Doc/library/zipfile.rst
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 2 GiB, no? I suggest we drop it (as discussed in the issue).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Doc/library/zipfile.rst
Comment on lines +207 to +212
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@StanFromIreland StanFromIreland removed the stale Stale PR or inactive for long period of time. label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants