Opened 5 years ago

Closed 3 years ago

Last modified 23 months ago

#17262 closed Cleanup/optimization (fixed)

Refactor the implementations of tzinfo classes

Reported by: Aymeric Augustin Owned by: Aymeric Augustin
Component: Utilities Version: 1.4
Severity: Normal Keywords: timezone tzinfo
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since the merge of the time zone support branch, django.utils.tzinfo and django.utils.timezone provide subtly different implementations of a tzinfo subclass representing local time.

The reason is explained at the bottom of this message. In short, the former is used for display and focuses on robustness; the latter is used for time zone support and focuses on correctness.

I think django.utils.tzinfo should be refactored and merged into django.utils.timezone, but that's probably not doable in a totally backwards-compatible fashion.

Change History (7)

comment:1 Changed 5 years ago by Preston Holmes

Keywords: timezone tzinfo added
Triage Stage: UnreviewedAccepted

comment:2 Changed 4 years ago by Aymeric Augustin

See also #18766.

comment:3 Changed 4 years ago by Aymeric Augustin

Component: Core (Other)Utilities

comment:4 Changed 3 years ago by Aymeric Augustin

Has patch: set
Version: 1.4

Pull request: https://github.com/django/django/pull/1601

Discussion: https://groups.google.com/d/msg/django-developers/zwQju7hbG78/jxpGZfdlxlcJ

I'll merge this in a few days, unless the discussion on django-developers reveals some good reasons not to.

comment:5 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>

Resolution: fixed
Status: newclosed

In ec2778b445546f624d3b3a1f2118e751b10bb2e7:

Fixed #17262 -- Refactored tzinfo implementations.

This commit deprecates django.utils.tzinfo in favor of the more recent
django.utils.timezone which was introduced when Django gained support
for time zones.

comment:6 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>

In d9413d33b2a8371731a92289123683cf6f440290:

Refactored code and tests that relied on django.utils.tzinfo.

Refs #17262.

comment:7 Changed 23 months ago by Tim Graham <timograham@…>

In 1b0365ad34151f266fe3faecb4edf31a51a8642c:

Removed django.utils.tzinfo per deprecation timeline; refs #17262.

Note: See TracTickets for help on using tickets.
Back to Top