Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adjust wording per vstinner's review.
  • Loading branch information
gpshead committed Oct 1, 2022
commit f01289c582c0361ebe30ac4e10ad3a611df9ab85
9 changes: 5 additions & 4 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2006,12 +2006,13 @@ and classes for traversing abstract syntax trees:
execute Python code, unlike the more general :func:`eval`. There is no
namespace, no name lookups, or ability to call out. But it is not free from
attack: A relatively small input can lead to memory exhaustion or to C stack
exhaustion, crashing the process. Calling it on untrusted input is thus
unwise.
exhaustion, crashing the process. There is also the possibility for
excessive CPU consumption denial of service on some inputs. Calling it on
untrusted data is thus not recommended.

.. warning::
It is possible to crash the Python interpreter with a complex string due
to stack depth limitations in Python's AST compiler.
It is possible to crash the Python interpreter due to stack depth
limitations in Python's AST compiler.

It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`,
:exc:`MemoryError` and :exc:`RecursionError` depending on the malformed
Expand Down