I'm trying to understand how the zoneinfo module figures out daylight savings time transitions in the distant future while it seems that dateutil and pytz both give up on daylight savings time transitions.
I know these transitions aren't really meaningful that far in the future but the inconsistency is potentially a problem and source of confusion.
import datetime
import zoneinfo
import pytz
from dateutil.tz import gettz as dateutil_gettz
eastern_zone = zoneinfo.ZoneInfo('America/New_York')
eastern_pytz = pytz.timezone('America/New_York')
eastern_dateutil = dateutil_gettz('America/New_York')
dates_7000 = [datetime.datetime(7000, month, 1) for month in range(1, 13)]
dates_7000_zone = [d.replace(tzinfo=eastern_zone) for d in dates_7000]
dates_7000_pytz = [eastern_pytz.localize(d) for d in dates_7000]
dates_7000_dateutil = [d.replace(tzinfo=eastern_dateutil) for d in dates_7000]
# for zoneinfo, there are two utcoffsets in this set
# datetime.timedelta(days=-1, seconds=68400)
# datetime.timedelta(days=-1, seconds=72000)
{d.utcoffset() for d in dates_7000_zone}
# for pytz and dateutil there is only one
# datetime.timedelta(days=-1, seconds=68400)
{d.utcoffset() for d in dates_7000_pytz}
{d.utcoffset() for d in dates_7000_dateutil}
I believe that zoneinfo is just carrying the final rule forward indefinitely. Is there anyway to figure out what that rule is and create a pytz or dateutil timezone that would follow it?