#37110 assigned Uncategorized

Use `zoneinfo` for validating `TIME_ZONE` setting instead of `Path("/usr/share/zoneinfo")`

Reported by: jodizzle Owned by:
Component: Uncategorized Version: dev
Severity: Normal Keywords:
Cc: jodizzle Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

On my system, I receive failures in the test suite related to the setting of TIME_ZONE, e.g., `test_incorrect_timezone`. The root issue is that Django 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 `zoneinfo` module. This module was introduced in Python 3.9, meaning all modern Django versions should support it's use.

I've attached the patch that fixes my test failures. I can submit a PR if this ticket is accepted.

Attachments (1)

zoneinfo-patch.diff (1.2 KB ) - added by jodizzle 45 minutes ago.

Download all attachments as: .zip

Change History (1)

by jodizzle, 45 minutes ago

Attachment: zoneinfo-patch.diff added
Note: See TracTickets for help on using tickets.
Back to Top