This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: zoneinfo may give incorrect dst() in Europe/Minsk in 1942
Type: Stage:
Components: Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: p-ganssle Nosy List: p-ganssle
Priority: normal Keywords:

Created on 2020-06-09 20:57 by p-ganssle, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg371141 - (view) Author: Paul Ganssle (p-ganssle) * (Python committer) Date: 2020-06-09 20:57
Related to bpo-40930 and bpo-40931, it *seems* that in 1942 only, `zoneinfo.ZoneInfo` returns -01:00 for DST in Europe/Minsk:

    >>> from datetime import datetime, timedelta
    >>> from backports.zoneinfo import ZoneInfo
    >>> datetime(1942, 1, 1, tzinfo=ZoneInfo("Europe/Minsk")).dst() // 
    timedelta(hours=1)

It looks like this occurs because they transitioned directly from MSK to CEST, jumping back 1 hour, then started switching between CEST and CET.

$ zdump -V -c 1941,1944 'Europe/Minsk'
Europe/Minsk  Fri Jun 27 20:59:59 1941 UT = Fri Jun 27 23:59:59 1941 MSK isdst=0 gmtoff=10800
Europe/Minsk  Fri Jun 27 21:00:00 1941 UT = Fri Jun 27 23:00:00 1941 CEST isdst=1 gmtoff=7200
Europe/Minsk  Mon Nov  2 00:59:59 1942 UT = Mon Nov  2 02:59:59 1942 CEST isdst=1 gmtoff=7200
Europe/Minsk  Mon Nov  2 01:00:00 1942 UT = Mon Nov  2 02:00:00 1942 CET isdst=0 gmtoff=3600
Europe/Minsk  Mon Mar 29 00:59:59 1943 UT = Mon Mar 29 01:59:59 1943 CET isdst=0 gmtoff=3600
Europe/Minsk  Mon Mar 29 01:00:00 1943 UT = Mon Mar 29 03:00:00 1943 CEST isdst=1 gmtoff=7200
Europe/Minsk  Mon Oct  4 00:59:59 1943 UT = Mon Oct  4 02:59:59 1943 CEST isdst=1 gmtoff=7200
Europe/Minsk  Mon Oct  4 01:00:00 1943 UT = Mon Oct  4 02:00:00 1943 CET isdst=0 gmtoff=3600

This might get fixed automatically if we do the "plurality" heuristic in bpo-40930, though we might also consider a heuristic that puts greater weight on a transition if the names associated with them different only by transforming a single letter, or insertion of a letter.

I am somewhat puzzled as to why only 1943 is affected, since I would have thought that all the CEST offsets in that stretch would be considered the same ttinfo (and thus all would be assigned the same dstoff).
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85105
2020-06-09 20:57:31p-gansslecreate