diff options
author | Raymond Hettinger <python@rcn.com> | 2003-02-13 22:58:02 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-02-13 22:58:02 (GMT) |
commit | 61436489f9eb6a4c4072b05fa9b5d6dc0ef20f2b (patch) | |
tree | b907d98fcc1c713097b35eef05c67b9900b0700d /Lib/calendar.py | |
parent | 1442dc11947fa8bd0da62c6a3282528c53bcf58f (diff) | |
download | cpython-61436489f9eb6a4c4072b05fa9b5d6dc0ef20f2b.zip cpython-61436489f9eb6a4c4072b05fa9b5d6dc0ef20f2b.tar.gz cpython-61436489f9eb6a4c4072b05fa9b5d6dc0ef20f2b.tar.bz2 |
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".
Diffstat (limited to 'Lib/calendar.py')
-rw-r--r-- | Lib/calendar.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/calendar.py b/Lib/calendar.py index 365ca26..fb56826 100644 --- a/Lib/calendar.py +++ b/Lib/calendar.py @@ -213,7 +213,7 @@ _EPOCH_ORD = datetime.date(EPOCH, 1, 1).toordinal() 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 |