Opened 4 years ago

Closed 3 years ago

Last modified 6 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 (14)

comment:1 by Carlton Gibson, 4 years ago

Version 0, edited 4 years ago by Carlton Gibson (next)

comment:2 by Mariusz Felisiak, 4 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Carlton Gibson <carlton@…>, 4 years ago

In 10d12619:

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

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

In a5d70cca:

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

Backport of 10d126198434810529e0220b0c6896ed64ca0e88 from master

comment:5 by Mariusz Felisiak, 3 years ago

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

comment:6 by Mariusz Felisiak, 3 years ago

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 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In d46e158:

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

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

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 by Carlton Gibson <carlton@…>, 3 years ago

In 59ab3fd0:

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

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In e6f8243:

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

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In 2fad163:

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

Per deprecation timeline.

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In d6816bff:

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

comment:13 by Sarah Boyce <42296566+sarahboyce@…>, 6 weeks ago

In 46eb256:

Refs #32365 -- Removed pytz from list of test dependencies in unit test docs.

Follow up to e6f82438d4e3750e8d299bfd79dac98eebe9f1e0.

comment:14 by Sarah Boyce <42296566+sarahboyce@…>, 6 weeks ago

In 6f32087:

[5.1.x] Refs #32365 -- Removed pytz from list of test dependencies in unit test docs.

Follow up to e6f82438d4e3750e8d299bfd79dac98eebe9f1e0.

Backport of 46eb256ccedcac6b1f6bc957461506d881d468fb from main.

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