[3.11] gh-139400: Make sure that parent parsers outlive their subparsers in pyexpat (GH-139403) by hartwork · Pull Request #139612 · python/cpython (original) (raw)

…rs in pyexpat (python#139403)

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)