[Python-bugs-list] 1.6a1 regression in string.atol (PR#279)

tim_one@email.msn.com tim_one@email.msn.com
Fri, 7 Apr 2000 00:36:47 -0400 (EDT)


Full_Name: Tim Peters
Version: 1.6a1
OS: Win95
Submission from: 1cust99.tnt4.bos1.da.uu.net (63.21.45.99)


Here's 1.5.2:

D:\Python>python
Python 1.5.42 (#0, Jan 31 2000, 14:05:14) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import string
>>> string.atol("45.67", 10)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
ValueError: invalid literal for atol(): 45.67
>>>

Here's 1.6a1:

D:\Python>\python-1.6\python
Python 1.6a1 (#0, Mar 30 2000, 16:30:28) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import string
>>> string.atol("45.67", 10)
45L
>>>

1.5.2 behavior is correct.  "int" and "long" are OK here in both.  string.atoi
and string.atol are OK here in both too *provided* that an explicit base
argument isn't given.  string.atoi is OK regardless.  So the regression appears
specific to string.atol with an explicit base argument.