stub42/pytz

DstTzInfo.localize() breaks for date '9999-12-31'

prasidmitra opened this issue · 0 comments

Bug

DstTzInfo.localize() breaks for date '9999-12-31'

Steps to reproduce

pytz.timezone("US/Pacific").localize(datetime(9999,12,31))

Error

OverflowError: date value out of range

Notes

Bug in

for delta in [timedelta(days=-1), timedelta(days=1)]:

Adding 1 day to 9999-12-31 is a date overflow