Skip to content

[3.12] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) - #139609

Merged
ambv merged 2 commits into
python:3.12from
hartwork:backport-6edb2dd-3.12
Oct 7, 2025
Merged

[3.12] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403)#139609
ambv merged 2 commits into
python:3.12from
hartwork:backport-6edb2dd-3.12

Conversation

@hartwork

@hartwork hartwork commented Oct 5, 2025

Copy link
Copy Markdown
Contributor
…rs in `pyexpat` (python#139403)

* Modules/pyexpat.c: Disallow collection of in-use parent parsers.

Within libexpat, a parser created via `XML_ExternalEntityParserCreate`
is relying on its parent parser throughout its entire lifetime.
Prior to this fix, is was possible for the parent parser to be
garbage-collected too early.

(cherry picked from commit 6edb2dd)
@hartwork hartwork changed the title [3.12] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) Oct 5, 2025
@picnixz picnixz assigned pablogsal and Yhg1s and unassigned pablogsal Oct 6, 2025
@picnixz

picnixz commented Oct 6, 2025

Copy link
Copy Markdown
Member

(Sorry for the misassignments; I got lost in my multiple tabs & backport versions :))

@ambv
ambv merged commit dea7e3d into python:3.12 Oct 7, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants