Skip to content

Commit d7da475

Browse files
brettcannonAWhetter
authored andcommitted
bpo-32758: Warn that compile() can crash when compiling to an AST object (pythonGH-6043)
(cherry picked from commit f7a6ff6) Co-authored-by: Brett Cannon <[email protected]>
1 parent c5abd63 commit d7da475

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
@@ -248,6 +248,12 @@ section.
248248
character. This is to facilitate detection of incomplete and complete
249249
statements in the :mod:`code` module.
250250

251+
.. warning::
252+
253+
It is possible to crash the Python interpreter with a
254+
sufficiently large/complex string when compiling to an AST
255+
object due to stack depth limitations in Python's AST compiler.
256+
251257
.. versionchanged:: 2.3
252258
The *flags* and *dont_inherit* arguments were added.
253259

0 commit comments

Comments
 (0)