[docs] [issue29146] Confusing "invalid token" exception when integers have leading zero
report at bugs.python.org
Tue Jan 3 16:12:51 EST 2017
New submission from John Parejko:
As described in PEP-3127, the "leading-zeros" formatting for octal was removed from python 3. This is a good thing(tm), but the recommendation of that PEP to improve the error message of the raised exception was apparently never implemented. I just ran into this while with some recently-ported python2 code, and it took a while to figure out the problem.
Although this is going to be less of a problem with time as people convert to pure python3, it will be very helpful during the transition period.
File "<stdin>", line 1
SyntaxError: invalid token
assignee: docs at python
components: 2to3 (2.x to 3.x conversion tool), Documentation, Interpreter Core
nosy: John Parejko, docs at python
title: Confusing "invalid token" exception when integers have leading zero
versions: Python 3.5
Python tracker <report at bugs.python.org>
More information about the docs