[issue23230] Bug parsing integers with zero padding

2015-01-13 Thread Mark Dickinson
Mark Dickinson added the comment: > is a base-10 zero padded comming from the parsing of a ip string If you're parsing an ip string, how do you end up with a 000 *literal*? The SyntaxError only applies to literals in Python code; it doesn't affect conversion from strings to integers. So you

[issue23230] Bug parsing integers with zero padding

2015-01-13 Thread R. David Murray
Changes by R. David Murray : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue23230] Bug parsing integers with zero padding

2015-01-13 Thread Luis G.F
Luis G.F added the comment: Thanks for the response, but in my case, 001 is not an octal literal, is a base-10 zero padded comming from the parsing of a ip string like 111.000.222.333 , where numbers are all integers in base-10. The solution for parsing that seams to cast 000 as string and the

[issue23230] Bug parsing integers with zero padding

2015-01-13 Thread Geoffrey Spear
Geoffrey Spear added the comment: This is not a bug, it's a deliberate change. Python 2.x doesn't "work correctly"; what you have there is an octal literal, not a 0-padded base-10 integer. Try 008 or 011 and be surprised that python 2 is "broken" and you'll see why this syntax was removed. --

[issue23230] Bug parsing integers with zero padding

2015-01-13 Thread Luis G.F
New submission from Luis G.F: Python 3.4 interpreter fail to parse a integer that has zero padding, whereas python 2.7 works properly. Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> int(001) 1 >>>