Skip to content

Commit 19b42fe

Browse files
Warn that compile() can crash when compiling to an AST object (GH-6043) (GH-6046)
(cherry picked from commit f7a6ff6) Co-authored-by: Brett Cannon <[email protected]>
1 parent b316c44 commit 19b42fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/functions.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ are always available. They are listed here in alphabetical order.
260260
character. This is to facilitate detection of incomplete and complete
261261
statements in the :mod:`code` module.
262262

263+
.. warning::
264+
265+
It is possible to crash the Python interpreter with a
266+
sufficiently large/complex string when compiling to an AST
267+
object due to stack depth limitations in Python's AST compiler.
268+
263269
.. versionchanged:: 3.2
264270
Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
265271
does not have to end in a newline anymore. Added the *optimize* parameter.

0 commit comments

Comments
 (0)