From 61436489f9eb6a4c4072b05fa9b5d6dc0ef20f2b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Thu, 13 Feb 2003 22:58:02 +0000 Subject: [PATCH] SF 685011: calendar module overflow handling Restored a Py2.2 behavior to not range check the day of the month. A user application was this exploiting undocumented, accidental "feature". --- Lib/calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/calendar.py b/Lib/calendar.py index 365ca263444..fb56826f6fb 100644 --- a/Lib/calendar.py +++ b/Lib/calendar.py @@ -213,7 +213,7 @@ def calendar(year, w=0, l=0, c=_spacing): def timegm(tuple): """Unrelated but handy function to calculate Unix timestamp from GMT.""" year, month, day, hour, minute, second = tuple[:6] - days = datetime.date(year, month, day).toordinal() - _EPOCH_ORD + days = datetime.date(year, month, 1).toordinal() - _EPOCH_ORD + day - 1 hours = days*24 + hour minutes = hours*60 + minute seconds = minutes*60 + second