diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index b26e0049a4a4caaf94c929b24afa0d17020d64f1..87796d541356f40110d8f23812670e8588cb48f4 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1506,6 +1506,10 @@ Changes in the Python API is larger than the population size, a :exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:`40465`.) +* :class:`ast.AST` node positions are now validated when provided to + :func:`compile` and other related functions. If invalid positions are detected, + a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:`93351`) + Build Changes ============= diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-07-23-19-16-25.gh-issue-93351.0Jyvu-.rst b/Misc/NEWS.d/next/Core and Builtins/2022-07-23-19-16-25.gh-issue-93351.0Jyvu-.rst new file mode 100644 index 0000000000000000000000000000000000000000..97cf8055ac54b16e39e09307ab9f384c3e767f16 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-07-23-19-16-25.gh-issue-93351.0Jyvu-.rst @@ -0,0 +1,3 @@ +:class:`ast.AST` node positions are now validated when provided to +:func:`compile` and other related functions. If invalid positions are +detected, a :exc:`ValueError` will be raised.