Comment 7 for bug 1995864

Revision history for this message
James Henstridge (jamesh) wrote :

Long term, it is probably best to move off of pytz. If you're okay to require Python >= 3.9 (released October 2020), then just use the built-in zoneinfo package.

    import pytz => import zoneinfo
    pytz.timezone("foo") => zoneinfo.ZoneInfo("foo")
    pytz.all_timezones => zoneinfo.available_timezones()

There are a few differences in how the two libraries treat repeated dates at daylight saving transitions: pytz tried to solve the problem back when there was ambiguity in the datetime module. The zoneinfo module was designed after they fixed the ambiguity and works a little differently. Chances are things will just work though.

The zoneinfo package does not rely on a hard coded list of time zones, so does not require updates when tzdata changes.