Skip to content

Commit 8eb27cc

Browse files
AWhetterbrettcannon
authored andcommitted
bpo-32758: Warn that compile() can crash when compiling to an AST object (GH-6043) (GH-16566)
(cherry picked from commit f7a6ff6) Co-authored-by: Brett Cannon <[email protected]>
1 parent bef8d9a commit 8eb27cc

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)