Code

Opened 2 years ago

Closed 7 months ago

Last modified 7 months ago

#17262 closed Cleanup/optimization (fixed)

Refactor the implementations of tzinfo classes

Reported by: aaugustin Owned by: aaugustin
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.

Attachments (0)

Change History (6)

comment:1 Changed 2 years ago by ptone

  • Keywords timezone tzinfo added
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 20 months ago by aaugustin

See also #18766.

comment:3 Changed 13 months ago by aaugustin

  • Component changed from Core (Other) to Utilities

comment:4 Changed 7 months ago by aaugustin

  • Has patch set
  • Version set to 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 7 months ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from new to closed

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 7 months ago by Aymeric Augustin <aymeric.augustin@…>

In d9413d33b2a8371731a92289123683cf6f440290:

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

Refs #17262.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.