cpython/Misc/NEWS.d/next/Core and Builtins/2023-12-13-11-45-53.gh-issu...

8 lines
353 B
ReStructuredText

Use per AST-parser state rather than global state to track recursion depth
within the AST parser to prevent potential race condition due to
simultaneous parsing.
The issue primarily showed up in 3.11 by multithreaded users of
:func:`ast.parse`. In 3.12 a change to when garbage collection can be
triggered prevented the race condition from occurring.