Skip to content

Release 3.10.22.3 - #123

Merged
icanhasmath merged 7 commits into
3.10.22.xfrom
3.10.22.3-release
Oct 29, 2026
Merged

icanhasmath merged 7 commits into
3.10.22.xfrom
3.10.22.3-release

Conversation

@icanhasmath

Copy link
Copy Markdown

Release 3.10.22.3, on top of 3.10.22.2. Merging this PR also merges #118 and #122: both branches are merged in unchanged, so GitHub marks them merged.

What's in it

Testing

tiran and others added 7 commits October 29, 2026 13:05
…9791)

(cherry picked from commit 38f331d)

3.10.22.x: applies cleanly. Needed on Windows once the build uses libffi
3.5 or later, whose ffi.h always declares the ffi_type_* symbols dllimport
(FFI_BUILDING no longer turns that off), so the static format table no
longer compiles (C2099).
…on#92357)

38f331d introduced a delayed initialization routine to set up
ctypes formattable (`_ctypes_init_fielddesc`), but inadvertently
removed setting the `initialization` flag to 1 to avoid initting
each time.

(cherry picked from commit adcb6a6)
…rfile extended headers (pythonGH-151498) (pythonGH-151978)

tarfile reads a member's extended header (a GNU long name/link or a pax
header) with a single read sized by the header's size field:

    buf = tarfile.fileobj.read(self._block(self.size))

The size is taken from the archive and is not validated, so a ~512-byte
crafted file can claim several gigabytes (or, via base-256 encoding, far
more) and make read() pre-allocate that much memory -- on open/iterate,
before any extraction filter runs.

Read the extended-header data in bounded chunks instead, so an oversized
or truncated header can no longer force a huge allocation. The bytes
returned for valid archives are unchanged.
(cherry picked from commit da99711)

Co-authored-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>

(cherry picked from commit b83961a)

3.10.22.x: the test_tarfile conflict was context only (test_extractfile_attrs, pythongh-74468, isn't on this line); only the ReadSizeRecorder and ExtendedHeaderMemoryTest classes are added.
pyexpatns.h prefixes the bundled Expat's exported symbols with PyExpat_ so
they cannot clash with a system libexpat loaded in the same process. Expat
2.9.0 added XML_SetHashSalt16Bytes, which pyexpat and _elementtree call,
but the header did not rename it (upstream main does not either). The
AllocTracker functions are already renamed on this line. Same change as
3.7.17.x 69ab1c8 (#117 review).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ActiveState release of the end-of-life 3.10 line, on top of 3.10.22.2: the
libffi 3.5+ ctypes build fix for Windows (bpo-45898, pythongh-92356), the
pythongh-151497 tarfile extended-header fix, and the remaining pyexpatns.h
renames for Expat 2.9.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@manoelc-dev
manoelc-dev self-requested a review October 29, 2026 22:42

@ezequielp-activestate ezequielp-activestate left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving.

  • This release's diff is the libffi ctypes backport plus the pythongh-151497 / pyexpatns.h change, both reviewed separately, plus the patchlevel.h bump to 3.10.22.3 and the What's New section.
  • The What's New section matches the code.

🟡 Non-blocking: besides dropping FFI_BUILDING, the _ctypes.vcxproj change defines USING_MALLOC_CLOSURE_DOT_C=1. On Windows, callback thunks then come from malloc_closure.c free-list pages rather than libffi's ffi_closure_alloc, because HAVE_FFI_CLOSURE_ALLOC isn't defined there. Upstream 3.11+ does the same, so this isn't a problem, but it is a runtime change beyond the build fix, and the release notes could mention it.

@icanhasmath
icanhasmath merged commit ce48941 into 3.10.22.x Oct 29, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants