Opened 6 years ago

Closed 6 years ago

Last modified 5 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 by Sergey Fedoseev, 6 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Tim Graham, 6 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Sergey Fedoseev, 6 years ago

Has patch: set

comment:4 by Tim Graham, 6 years ago

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 6 years ago by Tim Graham (previous) (diff)

comment:5 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 338f741:

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

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In cb2be9d5:

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

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