Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#29546 closed Cleanup/optimization (fixed)

deprecate timezone.FixedOffset in favor of datetime.timezone

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: Utilities Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We have FixedOffset class each instance of which represents a timezone defined by a fixed offset from UTC, in Python 3.2 was added datetime.timezone class needed for the same purpose, so now we can get rid of our implementation.
The possible pitfall is that FixedOffset.dst() returns timedelta(0), but datetime.timezone.dst() returns None.

Change History (6)

comment:1 Changed 4 years ago by Sergey Fedoseev

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 Changed 4 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:3 Changed 4 years ago by Sergey Fedoseev

Has patch: set

comment:4 Changed 4 years ago by Tim Graham

Perhaps the deprecation should be delayed and included in #27753, otherwise projects that want to continue to support Python2 won't be able to avoid the deprecation warning. Django's usage of FixedOffset could be removed now. Well, I don't think FixedOffset is something that many (if any) third-party packages are relying on.

Last edited 4 years ago by Tim Graham (previous) (diff)

comment:5 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 338f741:

Fixed #29546 -- Deprecated django.utils.timezone.FixedOffset.

comment:6 Changed 3 years ago by Mariusz Felisiak <felisiak.mariusz@…>

In cb2be9d5:

Refs #29546 -- Removed django.utils.timezone.FixedOffset per deprecation timeline.

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