Opened 2 years ago

Closed 17 months ago

Last modified 3 weeks ago

#32365 closed New feature (fixed)

Update timezone implementation to use zoneinfo

Reported by: Carlton Gibson Owned by: Carlton Gibson
Component: Utilities Version: 3.1
Severity: Normal Keywords:
Cc: 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

Python 3.9 introduced zoneinfo timezone objects, with backports available to Python 3.6.

As per discussion on mailing list we will adopt zoneinfo in Django 4.0, using a pytz compatibility shim for those who need it until Django 5.0.

In addition, as per follow-up discussion, we will make it possible to use zoneinfo objects from Django 3.2, leaving any handling of DST changes to early-adopter user code. (make_aware()'s is_dst likely to be deprecated in Django 4.0 — see follow-up discussion and comment on initial PR.)

Change History (12)

comment:2 Changed 2 years ago by Mariusz Felisiak

Triage Stage: UnreviewedAccepted

comment:3 Changed 2 years ago by Carlton Gibson <carlton@…>

In 10d12619:

Refs #32365 -- Allowed use of non-pytz timezone implementations.

comment:4 Changed 2 years ago by Carlton Gibson <carlton.gibson@…>

In a5d70cca:

[3.2.x] Refs #32365 -- Allowed use of non-pytz timezone implementations.

Backport of 10d126198434810529e0220b0c6896ed64ca0e88 from master

comment:5 Changed 17 months ago by Mariusz Felisiak

Has patch: set
Owner: changed from nobody to Carlton Gibson
Status: newassigned
Triage Stage: AcceptedReady for checkin

comment:6 Changed 17 months ago by Mariusz Felisiak

Resolution: fixed
Status: assignedclosed

In 306607d5b99b6eca6ae2c1e726d8eb32b9b2ca1b:

Fixed #32365 -- Made zoneinfo the default timezone implementation.

Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick
Pope, and Paul Ganssle for reviews.

comment:7 Changed 11 months ago by Carlton Gibson <carlton.gibson@…>

In d46e158:

Refs #32365 -- Made migration writer use datetime.timezone.utc.

comment:8 Changed 11 months ago by Mariusz Felisiak <felisiak.mariusz@…>

In bb61f018:

Refs #32365 -- Removed internal uses of utils.timezone.utc alias.

Remaining test case ensures that uses of the alias are mapped
canonically by the migration writer.

comment:9 Changed 10 months ago by Carlton Gibson <carlton@…>

In 59ab3fd0:

Refs #32365 -- Deprecated django.utils.timezone.utc.

comment:10 Changed 3 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

In e6f8243:

Refs #32365 -- Removed support for pytz timezones per deprecation timeline.

comment:11 Changed 3 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

In 2fad163:

Refs #32365 -- Removed is_dst argument for various methods and functions.

Per deprecation timeline.

comment:12 Changed 3 weeks ago by Mariusz Felisiak <felisiak.mariusz@…>

In d6816bff:

Refs #32365 -- Removed django.utils.timezone.utc per deprecation timeline.

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