[issue41887] ast.literal_eval does not accept strings with leading whitespaces

Guido van Rossum report at bugs.python.org
Sat Oct 3 01:10:35 EDT 2020


Guido van Rossum <guido at python.org> added the comment:

[Terry]
> But why should not parsing remove indents for 'eval' mode?

I dunno, but it's been doing this since 1992, so I think it would be fragile to change. The best thing therefore is to make ast.literal_eval() match it exactly.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41887>
_______________________________________


More information about the Python-bugs-list mailing list