-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dateutil mishandles today's dates on NetBSD 9.0 etc. #1059
Comments
Thanks. Now that At the same time I'm planning to switch our "fall-back" zones to using the |
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
This should be reverted when support for version 2+ TZif files is added (see dateutilGH-1059).
Now that the slim format has become the default, tests fail on distros which packaged tzdata 2020b as-is. It's easy to reproduce on Arch before they reverted to fat bloats in archlinux/svntogit-packages@7d8fb81: FROM archlinux
RUN pacman --noconfirm -Syu
RUN pacman --noconfirm -S git python-tox
RUN pacman --noconfirm -U https://archive.archlinux.org/packages/t/tzdata/tzdata-2020b-1-x86_64.pkg.tar.zst
RUN git clone --depth 1 https://github.com/dateutil/dateutil/
WORKDIR dateutil
RUN tox -e py38 This yields Example error:
|
I have created PR#1091, which should fix this issue. |
Just for some more context: Looks like alpine is now using the newest zic, so timezones aren't working out of the box for those containers. |
This problem should go away once PR#1091 gets merged into dateutil. I don't know what the schedule for that is. |
I might be able to look at it this weekend. Last time I tried to get some stuff merged to prepare a release, the CI was pretty broken and annoyingly hard to fix, which ate up all my OSS time for that day. |
dateutil still isn't ready. Bug: https://bugs.gentoo.org/747538 Bug: dateutil/dateutil#1059 Bug: dateutil/dateutil#1091 Bug: dateutil/dateutil#1130 Signed-off-by: Sam James <sam@gentoo.org>
#462 talks about a longstanding bug in dateutil. In 1995, tzcode 95f introduced a 64-bit extension to TZif files, designed to make them work after the year 2038. dateutil's TZif parser does not use this data, causing it to mishandle timestamps after the last explicit 32-bit transition in a TZif file, which means timestamps after 2038 in (say) Los Angeles are mishandled by dateutil. I'm sure you've been meaning to fix this before 2038 rolls around.
Something new has happened, though. A year ago, tzdb 2019b introduced the '-b slim' flag to the zic command, causing it to omit unnecessary data, the idea being to speed up the parsing of TZif files and make them smaller. Since the 32-bit data entries are always unnecessary, they're omitted. NetBSD 9.0, dated 2020-02-14, is using the '-b slim' flag to generate its TZif files, which means dateutil does not work even for today's timestamps on NetBSD. I assume other platforms will follow suit.
This change means it's time to boost the priority of fixing this bug.
To reproduce the problem, run the shell script datetime-slim-bug.sh (see below) in a writeable directory. It will create a slim TZif file 'Los_Angeles' and will use it to convert the time_t value 1592782632 into Los Angeles time. GNU 'date' handles this correctly, but datetime gets confused and thinks that Los Angeles is observing UTC. On my platform (Fedora 31 x86-64, Python 3.7.7, datetime 2.8.0) this script outputs:
The first line (from GNU 'date') is correct; the second line (from datetime) is wrong).
Here are the contents of datetime-slim-bug.sh:
The text was updated successfully, but these errors were encountered: