[Django] #37110: Use `zoneinfo` for validating `TIME_ZONE` setting instead of `Path("/usr/share/zoneinfo")`
6 views
Skip to first unread message
Django
unread,
May 19, 2026, 3:29:26 PM (2 days ago) May 19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-...@googlegroups.com
#37110: Use `zoneinfo` for validating `TIME_ZONE` setting instead of
`Path("/usr/share/zoneinfo")`
-----------------------------------------+--------------------------
Reporter: jodizzle | Owner: (none)
Type: Uncategorized | Status: assigned
Component: Uncategorized | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+--------------------------
On my system, I receive failures in the test suite related to the setting
of `TIME_ZONE`, e.g.,
[https://github.com/django/django/blob/3e4e0db66961a48a080ff3ff91f6c0d954261366/tests/settings_tests/tests.py#L338 `test_incorrect_timezone`]. The root issue is that Django
[https://github.com/django/django/blob/3e4e0db66961a48a080ff3ff91f6c0d954261366/django/conf/__init__.py#L281 validates `TIME_ZONE` against a hardcoded "/usr/share/zoneinfo" path]
which does not exist on my system.
Thankfully, Python has standard library support for validating timezones
via the [https://docs.python.org/3/library/zoneinfo.html `zoneinfo`
module]. This module was introduced in Python 3.9, meaning all modern
Django versions should support it's use.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-...@googlegroups.com
#37110: Use `zoneinfo` for validating `TIME_ZONE` setting instead of
`Path("/usr/share/zoneinfo")`
-------------------------------+--------------------------------------