parse() throws OverflowError for large integers

Bug #1285789 reported by Nicholas Chammas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dateutil
New
Undecided
Unassigned

Bug Description

>>> parse('18129168625565982')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/dateutil/parser.py", line 720, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/lib/python2.6/site-packages/dateutil/parser.py", line 317, in parse
    ret = default.replace(**repl)
OverflowError: signed integer is greater than maximum

I expect a ValueError in this case, not an OverflowError.

Interestingly, Python can handle the integer as an int without issues.

>>> type(18129168625565982)
<type 'int'>

Revision history for this message
Matan (matanster) wrote :

I think so too. Still getting this in 2018 and python 3 with the latest anaconda distribution

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.