summaryrefslogtreecommitdiffstats
path: root/Doc/library/ast.rst
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-03-09 20:35:14 (GMT)
committerBrett Cannon <brettcannon@users.noreply.github.com>2018-03-09 20:35:14 (GMT)
commitb316c44b0105d11a80ff971636143735f3655bbf (patch)
tree688d843ed63a3fa3163ffd6948570651a4190ccb /Doc/library/ast.rst
parent3f7d0b69f2175ff74157673148b2e45b7a2498b6 (diff)
downloadcpython-b316c44b0105d11a80ff971636143735f3655bbf.zip
cpython-b316c44b0105d11a80ff971636143735f3655bbf.tar.gz
cpython-b316c44b0105d11a80ff971636143735f3655bbf.tar.bz2
bpo-32758: Warn that ast.parse() and ast.literal_eval() can segfault the interpreter (GH-5960) (GH-6042)
(cherry picked from commit 7a7f100eb352d08938ee0f5ba59c18f56dc4a7b5) Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
Diffstat (limited to 'Doc/library/ast.rst')
-rw-r--r--Doc/library/ast.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 8d4ae2c..6376f5f 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -113,6 +113,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)
@@ -126,6 +131,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.
+
.. versionchanged:: 3.2
Now allows bytes and set literals.