]> granicus.if.org Git - python/commitdiff
Warn that compile() can crash when compiling to an AST object (GH-6043)
authorBrett Cannon <brettcannon@users.noreply.github.com>
Fri, 9 Mar 2018 21:13:32 +0000 (13:13 -0800)
committerGitHub <noreply@github.com>
Fri, 9 Mar 2018 21:13:32 +0000 (13:13 -0800)
Doc/library/functions.rst

index bfb813cf39060a27fb112c888fdc013792b02112..3ddd280f77ebc9c4c267c6a571f490a2453194d8 100644 (file)
@@ -274,6 +274,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.