Opened 3 weeks ago
Closed 4 days ago
#37110 closed Cleanup/optimization (fixed)
Use `zoneinfo` for validating `TIME_ZONE` setting instead of `Path("/usr/share/zoneinfo")`
| Reported by: | jodizzle | Owned by: | jodizzle |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Normal | Keywords: | settings |
| Cc: | jodizzle | Triage Stage: | Ready for checkin |
| 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)
Change History (11)
by , 3 weeks ago
| Attachment: | zoneinfo-patch.diff added |
|---|
comment:1 by , 3 weeks ago
| Owner: | set to |
|---|
comment:2 by , 3 weeks ago
| Component: | Uncategorized → Testing framework |
|---|
comment:3 by , 3 weeks ago
| Type: | Uncategorized → Bug |
|---|
comment:4 by , 3 weeks ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Bug → Cleanup/optimization |
comment:7 by , 5 days ago
| Component: | Testing framework → Core (Other) |
|---|---|
| Keywords: | settings added |
comment:9 by , 4 days ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Refs #3415
Thank you for the suggestion