[New-bugs-announce] [issue40933] zoneinfo may give incorrect dst() in Europe/Minsk in 1942
Paul Ganssle
report at bugs.python.org
Tue Jun 9 16:57:31 EDT 2020
New submission from Paul Ganssle <p.ganssle at gmail.com>:
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).
----------
assignee: p-ganssle
messages: 371141
nosy: p-ganssle
priority: normal
severity: normal
status: open
title: zoneinfo may give incorrect dst() in Europe/Minsk in 1942
versions: Python 3.8, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40933>
_______________________________________
More information about the New-bugs-announce
mailing list