]> granicus.if.org Git - python/commitdiff
Warn that compile() can crash when compiling to an AST object (GH-6043) (GH-6046)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 9 Mar 2018 21:40:39 +0000 (13:40 -0800)
committerBrett Cannon <brettcannon@users.noreply.github.com>
Fri, 9 Mar 2018 21:40:39 +0000 (13:40 -0800)
(cherry picked from commit f7a6ff6fcab32a53f262ba3f8a072c27afc330d7)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
Doc/library/functions.rst

index 3b479bd64294d1d13ed6a28dc1a50793f797ec0e..bc4203081ed0457735a61db2793425865f15da3d 100644 (file)
@@ -260,6 +260,12 @@ are always available.  They are listed here in alphabetical order.
       character.  This is to facilitate detection of incomplete and complete
       statements in the :mod:`code` module.
 
+   .. warning::
+
+      It is possible to crash the Python interpreter with a
+      sufficiently large/complex string when compiling to an AST
+      object due to stack depth limitations in Python's AST compiler.
+
    .. versionchanged:: 3.2
       Allowed use of Windows and Mac newlines.  Also input in ``'exec'`` mode
       does not have to end in a newline anymore.  Added the *optimize* parameter.