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 does not support full range of allowed transition hours in fallback string
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: p-ganssle, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-12-16 21:33 by p-ganssle, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 23825 open serhiy.storchaka, 2020-12-17 21:05
Messages (1)
msg383206 - (view) Author: Paul Ganssle (p-ganssle) * (Python committer) Date: 2020-12-16 21:33
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.
History
Date User Action Args
2022-04-11 14:59:39adminsetgithub: 86829
2020-12-17 21:05:55serhiy.storchakasetkeywords: + patch
nosy: + serhiy.storchaka

pull_requests: + pull_request22686
stage: needs patch -> patch review
2020-12-16 21:33:53p-gansslecreate