Cannot localize days on boundary of representable dates

Bug #1435758 reported by on 2015-03-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Either of the following will error with an OverflowError: date value out of range:

pytz.timezone('Africa/Abidjan').localize(datetime(year=1, month=1, day=1))

pytz.timezone('Africa/Abidjan').localize(datetime(year=9999, month=12, day=31))

This is because in the localize function ( in the 2015.2 release) you look at the previous and the next day, but those might not be representable dates.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers