Edgewall Software

Opened 8 years ago

Last modified 8 years ago

#12372 closed defect

OverflowError: signed integer is greater than maximum — at Version 3

Reported by: Ryan J Ollos Owned by: Jun Omae
Priority: normal Milestone: 1.0.11
Component: timeline Version: 1.0
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

From the logs:

2016-02-15 16:54:12,734 Trac[main] ERROR: Internal Server Error: <RequestWithSession "GET '/timeline?daysback=7&authors=&from=2010-12-122121121121212.1'">, referrer None
Traceback (most recent call last):
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 554, in _dispatch_request
    dispatcher.dispatch(req)
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/web/main.py", line 247, in dispatch
    resp = chosen_handler.process_request(req)
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/timeline/web_ui.py", line 115, in process_request
    precisedate = user_time(req, parse_date, reqfromdate)
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/util/datefmt.py", line 793, in user_time
    return func(*args, **kwargs)
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/util/datefmt.py", line 518, in parse_date
    dt = _i18n_parse_date(text, tzinfo, locale)
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/util/datefmt.py", line 646, in _i18n_parse_date
    month_names, tzinfo)
  File "/var/www/bugs.jquery.com/private/pve/local/lib/python2.7/site-packages/trac/util/datefmt.py", line 702, in _i18n_parse_date_0
    t = tzinfo.localize(datetime(*(values[k] for k in 'yMdhms')))
OverflowError: signed integer is greater than maximum

Related to #12007.

Change History (3)

comment:1 by Jun Omae, 8 years ago

Owner: set to Jun Omae
Status: newassigned
Version: 1.0

Good catch. parse_date() should catch OverflowError.

>>> parse_date('Jan 2147483647, 2016', locale='en_US')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 477, in parse_date
    date=text, hint=hint), _('Invalid Date'))
trac.core.TracError: "2147483647 Jan, 2016" is an invalid date, or the date format is not known. Try "MMM d, yyyy" instead.
>>> parse_date('Jan 2147483648, 2016', locale='en_US')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 458, in parse_date
    dt = _i18n_parse_date(text, tzinfo, locale)
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 571, in _i18n_parse_date
    month_names, tzinfo)
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 627, in _i18n_parse_date_0
    t = tzinfo.localize(datetime(*(values[k] for k in 'yMdhms')))
OverflowError: signed integer is greater than maximum
>>> parse_date('Jan 9223372036854775808, 2016', locale='en_US')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 458, in parse_date
    dt = _i18n_parse_date(text, tzinfo, locale)
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 571, in _i18n_parse_date
    month_names, tzinfo)
  File "/venv/trac/1.0/lib/python2.5/site-packages/trac/util/datefmt.py", line 627, in _i18n_parse_date_0
    t = tzinfo.localize(datetime(*(values[k] for k in 'yMdhms')))
OverflowError: long int too large to convert to int

comment:2 by Jun Omae, 8 years ago

comment:3 by Ryan J Ollos, 8 years ago

Description: modified (diff)

Changes look good. Thanks for fixing!

Note: See TracTickets for help on using tickets.