[New-bugs-announce] [issue42663] zoneinfo does not support full range of allowed transition hours in fallback string
report at bugs.python.org
Wed Dec 16 16:33:53 EST 2020
New submission from Paul Ganssle <p.ganssle at gmail.com>:
TZif files consist of a list of transitions followed by a POSIX TZ var-style string of a form like "AAA3BBB,M3.2.0/01:30,M11.1.0/02:15:45", which decodes to "AAA (UTC-3) is the standard time and BBB (UTC-2) is the DST time, DST applies starting at 02:15:45 local time on the 1st Sunday in November and ending at 1:30:00 local time on the 2nd Sunday in March". After the last listed transition, the rule specified by the TZ variable applies.
POSIX says that the "hours" part of the transition rule must be in the range ±24, but as mentioned in a TODO comment in _zoneinfo.c, RFC 8536 §3.3.1 specifies that the hours part of transition times may range from -167 to 167 (see: https://github.com/python/cpython/blob/master/Modules/_zoneinfo.c#L1844-L1847 ).
Currently, zoneinfo does not support the full range of possible transitions, and a TZif file with a 3-digit transition hour would likely fail to parse. This isn't a terribly high priority at the moment, but if the tz project ever releases a TZif file with one of these TZ strings on it, it will all of a sudden become very critical to fix it, so we should probably try to get it fixed before Python 3.9 is EOL, so that all versions of Python with `zoneinfo` can handle this properly.
components: Library (Lib)
stage: needs patch
title: zoneinfo does not support full range of allowed transition hours in fallback string
versions: Python 3.10, Python 3.9
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce