bpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter (GH-5960) (GH-16565)
(cherry picked from commit 7a7f100eb3
)
Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
This commit is contained in:
parent
8eb27cc354
commit
dedb99acdb
|
@ -129,6 +129,11 @@ and classes for traversing abstract syntax trees:
|
|||
Parse the source into an AST node. Equivalent to ``compile(source,
|
||||
filename, mode, ast.PyCF_ONLY_AST)``.
|
||||
|
||||
.. warning::
|
||||
It is possible to crash the Python interpreter with a
|
||||
sufficiently large/complex string due to stack depth limitations
|
||||
in Python's AST compiler.
|
||||
|
||||
|
||||
.. function:: literal_eval(node_or_string)
|
||||
|
||||
|
@ -142,6 +147,11 @@ and classes for traversing abstract syntax trees:
|
|||
capable of evaluating arbitrarily complex expressions, for example involving
|
||||
operators or indexing.
|
||||
|
||||
.. warning::
|
||||
It is possible to crash the Python interpreter with a
|
||||
sufficiently large/complex string due to stack depth limitations
|
||||
in Python's AST compiler.
|
||||
|
||||
|
||||
.. function:: get_docstring(node, clean=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue