cpython/Misc/NEWS.d
Carey Metcalfe 798bcaa1eb
gh-103861: Fix Zip64 extensions not being properly applied in some cases (#103863)
Fix Zip64 extensions not being properly applied in some cases:

Fixes an issue where adding a small file to a `ZipFile`
object while forcing zip64 extensions causes an extra Zip64 record to be
added to the zip, but doesn't update the `min_version` or file sizes in
the primary central directory header.

Also fixed an edge case in checking if zip64 extensions are required:

This fixes an issue where if data requiring zip64 extensions was added
to an unseekable stream without specifying `force_zip64=True`, zip64
extensions would not be used and a RuntimeError would not be raised when
closing the file (even though the size would be known at that point).
This would result in successfully writing corrupt zip files.

Deciding if zip64 extensions are required outside of the `FileHeader`
function means that both `FileHeader` and `_ZipWriteFile` will always be
in sync. Previously, the `FileHeader` function could enable zip64
extensions without propagating that decision to the `_ZipWriteFile`
class, which would then not correctly write the data descriptor record
or check for errors on close.

If anyone is actually using `ZipInfo.FileHeader` as a public API without
explicitly passing True or False in for zip64, their own code may still be
susceptible to that kind of bug unless they make a similar change to
where the zip64 decision happens.

Fixes #103861

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-05-16 00:43:44 -07:00
..
next gh-103861: Fix Zip64 extensions not being properly applied in some cases (#103863) 2023-05-16 00:43:44 -07:00
3.5.0.rst
3.5.0a1.rst gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768) 2022-10-05 11:01:14 -07:00
3.5.0a2.rst
3.5.0a3.rst
3.5.0a4.rst
3.5.0b1.rst
3.5.0b2.rst
3.5.0b3.rst
3.5.0b4.rst
3.5.0rc1.rst
3.5.0rc2.rst
3.5.0rc3.rst
3.5.0rc4.rst
3.5.1.rst
3.5.1rc1.rst gh-95454: Replace truthy/falsy with true/false (GH-95456) 2022-07-30 00:42:21 -07:00
3.5.2.rst
3.5.2rc1.rst
3.5.3.rst
3.5.3rc1.rst gh-95454: Replace truthy/falsy with true/false (GH-95456) 2022-07-30 00:42:21 -07:00
3.5.4.rst
3.5.4rc1.rst
3.5.5.rst
3.5.5rc1.rst
3.6.0.rst
3.6.0a1.rst
3.6.0a2.rst
3.6.0a3.rst
3.6.0a4.rst
3.6.0b1.rst
3.6.0b2.rst gh-95454: Replace truthy/falsy with true/false (GH-95456) 2022-07-30 00:42:21 -07:00
3.6.0b3.rst
3.6.0b4.rst
3.6.0rc1.rst
3.6.0rc2.rst
3.6.1.rst
3.6.1rc1.rst
3.6.2.rst
3.6.2rc1.rst
3.6.2rc2.rst
3.6.3.rst
3.6.3rc1.rst
3.6.4.rst
3.6.4rc1.rst
3.6.5.rst
3.6.5rc1.rst
3.6.6.rst
3.6.6rc1.rst
3.7.0.rst
3.7.0a1.rst GH-103484: Fix redirected permanently URLs (#104001) 2023-05-02 09:34:44 +03:00
3.7.0a2.rst
3.7.0a3.rst
3.7.0a4.rst
3.7.0b1.rst
3.7.0b2.rst GH-103484: Fix broken links reported by linkcheck (#103608) 2023-04-22 08:24:47 -06:00
3.7.0b3.rst
3.7.0b4.rst
3.7.0b5.rst
3.7.0rc1.rst
3.8.0a1.rst GH-98040: Suppress cross-references to the removed ``imp`` module (#104131) 2023-05-03 13:29:42 +01:00
3.8.0a2.rst Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) 2022-07-05 11:16:10 +02:00
3.8.0a3.rst
3.8.0a4.rst gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (#97775) 2022-10-04 16:32:27 -07:00
3.8.0b1.rst
3.9.0a1.rst GH-103484: Fix broken links reported by linkcheck (#103608) 2023-04-22 08:24:47 -06:00
3.9.0a2.rst GH-103484: Fix broken links reported by linkcheck (#103608) 2023-04-22 08:24:47 -06:00
3.9.0a3.rst docs: Change links to label refs (#98454) 2022-10-25 20:26:28 -07:00
3.9.0a4.rst GH-103484: Fix broken links reported by linkcheck (#103608) 2023-04-22 08:24:47 -06:00
3.9.0a5.rst gh-85454: Remove links from historical mentions of distutils (GH-95192) 2022-07-25 12:20:09 +02:00
3.9.0a6.rst
3.9.0b1.rst gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768) 2022-10-05 11:01:14 -07:00
3.10.0a1.rst gh-85454: Remove links from historical mentions of distutils (GH-95192) 2022-07-25 12:20:09 +02:00
3.10.0a2.rst gh-101100: Test docs in nit-picky mode (#102513) 2023-03-24 13:23:35 +02:00
3.10.0a3.rst Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) 2022-07-05 11:16:10 +02:00
3.10.0a4.rst Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) 2022-07-05 11:16:10 +02:00
3.10.0a5.rst GH-97850: Suppress cross-references to removed ``importlib.util`` functions (#104134) 2023-05-03 14:13:03 +01:00
3.10.0a6.rst
3.10.0a7.rst
3.10.0b1.rst gh-85454: Remove links from historical mentions of distutils (GH-95192) 2022-07-25 12:20:09 +02:00
3.11.0a1.rst gh-85454: Remove links from historical mentions of distutils (GH-95192) 2022-07-25 12:20:09 +02:00
3.11.0a2.rst Fix name of removed `inspect.Signature.from_builtin` method in 3.11.0a2 changelog (#100525) 2022-12-26 17:04:18 +05:30
3.11.0a3.rst
3.11.0a4.rst Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) 2022-07-05 11:16:10 +02:00
3.11.0a5.rst
3.11.0a6.rst Fix duplicated words in the docs (GH-102629) 2023-03-12 11:03:59 -07:00
3.11.0a7.rst no-issue: Fix typo in 3.11.0a7.rst (gh-96547) 2022-09-04 22:17:26 +09:00
3.11.0b1.rst Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) 2022-07-05 11:16:10 +02:00
3.12.0a1.rst GH-97850: Suppress cross-references to removed ``importlib.util`` functions (#104134) 2023-05-03 14:13:03 +01:00
3.12.0a2.rst Remove misformatted exclamation marks in docs (#102694) 2023-03-15 09:06:32 +02:00
3.12.0a3.rst Python 3.12.0a3 2022-12-06 19:33:02 +01:00
3.12.0a4.rst Python 3.12.0a4 2023-01-10 13:09:15 +01:00
3.12.0a5.rst Python 3.12.0a5 2023-02-07 13:21:15 +01:00
3.12.0a6.rst GH-84783: Mention Author for GH-101264 (make slices hashable) (#103146) 2023-03-31 09:54:17 -04:00
3.12.0a7.rst Python 3.12.0a7 2023-04-04 17:52:42 +02:00