[docs] [issue32758] Stack overflow when parse long expression to AST

Serhiy Storchaka report at bugs.python.org
Sat Feb 24 02:04:16 EST 2018

Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

A consequence of this is that ast.literal_eval() can crash.

>>> import ast
>>> ast.literal_eval("+0"*200000)
Segmentation fault (core dumped)

It should be documented that ast.literal_eval() is not safe.


Python tracker <report at bugs.python.org>

More information about the docs mailing list