From fccbe55417f6b8fdd73289f18afcf7de3696d5f9 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 28 Jun 2026 16:29:49 +0800 Subject: [PATCH 1/3] gh-73199: Fix incorrect zip64 threshold in doc --- Doc/library/zipfile.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 98d2a5e5cdf00e2..28bb8e88fd9936d 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -204,10 +204,12 @@ ZipFile objects (:mod:`zlib`, :mod:`bz2`, :mod:`lzma`, or :mod:`compression.zstd`) is not available, :exc:`RuntimeError` is raised. The default is :const:`ZIP_STORED`. - If *allowZip64* is ``True`` (the default) zipfile will create ZIP files that - use the ZIP64 extensions when the zipfile is larger than 4 GiB. If it is - ``false`` :mod:`!zipfile` will raise an exception when the ZIP file would - require ZIP64 extensions. + 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 a + member file 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 in + such cases. The *compresslevel* parameter controls the compression level to use when writing files to the archive. From 93d54a93769c594c6843de307a86d12770b2156f Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 4 Jul 2026 09:53:23 +0800 Subject: [PATCH 2/3] Minor rephrase --- Doc/library/zipfile.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 28bb8e88fd9936d..53aa7b47ac287bc 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -205,11 +205,11 @@ ZipFile objects available, :exc:`RuntimeError` is raised. The default is :const:`ZIP_STORED`. 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 a - member file 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 in - such cases. + 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. The *compresslevel* parameter controls the compression level to use when writing files to the archive. From aed82dc485ec0403e8fc421e0625cb85f0ba391d Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 4 Jul 2026 09:57:32 +0800 Subject: [PATCH 3/3] Rephrase another inaccurate statement --- Doc/library/zipfile.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 53aa7b47ac287bc..cd390e4764f1ca7 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -15,7 +15,7 @@ defined in `PKZIP Application Note`_. 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 decryption of encrypted files in ZIP archives, but it cannot create an encrypted file. Decryption is extremely slow as it is implemented in native Python rather than C.