Menu

1 / 9

Python ZoneInfoNotFoundError: test for missing tzdata before shipping Docker

DEV Community: docker·Pobiru·3 days ago
#D5wIJdzs
#devtodocker#devto#dev#zoneinfo#python
Long article (613 words) — no AI summary yet.
Reading 0:00
15s threshold

Your laptop recognizes America/New_York . The container throws ZoneInfoNotFoundError . Test the same lookup with system timezone files deliberately out of reach before changing a key or adding a library.

1. Where the timezone rules came from

Python tries directories in zoneinfo.TZPATH before the tzdata package. A successful local lookup may never have touched the dependencies you declared. The Python documentation describes the search order.

2. Reproduce the failure in a fresh process

The lab used CPython 3.12.14 on Linux with OS zone files and the Python tzdata wheel. All four cases ran in fresh interpreters so the lookup cache could not carry a result forward. No Windows or Docker run was performed in the lab.

Run this to check whether a valid key is already present in the system files. In this lab -S kept the wheel out of the import path, yet New York still returned two seasonal offsets.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.