Issue 13688: ast.literal_eval fails on octal numbers (original) (raw)
Python 3.2.2 (default, Nov 16 2011, 10:58:44) [C] on sunos5 Type "help", "copyright", "credits" or "license" for more information.
import ast ast.literal_eval('10') 10 ast.literal_eval('0x10') 16 ast.literal_eval('010') Traceback (most recent call last): File "", line 1, in File "/opt/python322/lib/python3.2/ast.py", line 48, in literal_eval node_or_string = parse(node_or_string, mode='eval') File "/opt/python322/lib/python3.2/ast.py", line 36, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "", line 1 010 ^ SyntaxError: invalid token