[issue5133] Error with Eval

Raymond Hettinger report at bugs.python.org
Mon Feb 2 20:02:56 CET 2009


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

They don't crash.  They raise a SyntaxError because the "08" and "09"
are invalid octal literals.

If you're working with decimal literals that are padded on the left with
zeroes, those need to be stripped off before conversion:

   '000987'.lstrip('0') --> '987'

Or, you can use the int() function:

   int('000987')

----------
nosy: +rhettinger
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5133>
_______________________________________


More information about the Python-bugs-list mailing list