Yeah, string.atoi() internally calls eval(), which interprets this as
an illegal octal number. According to the documentation string.atoi()
is not supposed to handle octal numbers, so I'll fix it. (Would this
break anybody's code?)
Here is what I believe is a fixed version of string.atoi():
# Convert string to integer
atoi_error = 'non-numeric argument to string.atoi'
sign = ''
s = str
if s[:1] in '+-':
sign = s
s = s[1:]
if not s: raise atoi_error, str
while s == '0' and len(s) > 1: s = s[1:]
for c in s:
if c not in digits: raise atoi_error, str
return eval(sign + s)
--Guido van Rossum, CWI, Amsterdam <firstname.lastname@example.org>
"Are all your pets called Eric?"