[Python-bugs-list] [ python-Bugs-685011 ] calendar module overflow handling
SourceForge.net
noreply@sourceforge.net
Tue, 11 Feb 2003 16:34:15 -0800
Bugs item #685011, was opened at 2003-02-12 11:34
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=685011&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Jones (richard)
Assigned to: Nobody/Anonymous (nobody)
Summary: calendar module overflow handling
Initial Comment:
The calendar module has lost a significant area of functionality in
Python 2.3
- that of handling overflows in the tuples passed to timegm().
Python 2.2.2 (#1, Oct 28 2002, 16:39:08)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time,calendar
>>> time.gmtime(calendar.timegm((2003,1,30,0,0,0,0,0,0)))
(2003, 1, 30, 0, 0, 0, 3, 30, 0)
>>> time.gmtime(calendar.timegm((2003,2,30,0,0,0,0,0,0)))
(2003, 3, 2, 0, 0, 0, 6, 61, 0)
>>>
Python 2.3a1 (#1, Feb 6 2003, 14:54:16)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time,calendar
>>> time.gmtime(calendar.timegm((2003,1,30,0,0,0,0,0,0)))
(2003, 1, 30, 0, 0, 0, 3, 30, 0)
>>> time.gmtime(calendar.timegm((2003,2,30,0,0,0,0,0,0)))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.3/calendar.py", line 216, in timegm
days = datetime.date(year, month, day).toordinal() - _EPOCH_ORD
ValueError: day is out of range for month
>>>
Is this functionality likely to be reinstated for 2.3's release?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=685011&group_id=5470