Skip to content

Commit f7a6ff6

Browse files
authored
Warn that compile() can crash when compiling to an AST object (GH-6043)
1 parent 7a7f100 commit f7a6ff6

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
@@ -274,6 +274,12 @@ are always available. They are listed here in alphabetical order.
274274
character. This is to facilitate detection of incomplete and complete
275275
statements in the :mod:`code` module.
276276

277+
.. warning::
278+
279+
It is possible to crash the Python interpreter with a
280+
sufficiently large/complex string when compiling to an AST
281+
object due to stack depth limitations in Python's AST compiler.
282+
277283
.. versionchanged:: 3.2
278284
Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
279285
does not have to end in a newline anymore. Added the *optimize* parameter.

0 commit comments

Comments
 (0)