[Django] #29546: deprecate timezone.FixedOffset in favor of datetime.timezone

8 views
Skip to first unread message

Django

unread,
Jul 5, 2018, 1:41:43 PM7/5/18
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
------------------------------------------------+------------------------
Reporter: Sergey Fedoseev | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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`.

--
Ticket URL: <https://code.djangoproject.com/ticket/29546>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 5, 2018, 1:41:53 PM7/5/18
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* status: new => assigned
* owner: nobody => Sergey Fedoseev


--
Ticket URL: <https://code.djangoproject.com/ticket/29546#comment:1>

Django

unread,
Jul 6, 2018, 11:18:52 AM7/6/18
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/29546#comment:2>

Django

unread,
Jul 7, 2018, 4:31:34 AM7/7/18
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: Utilities | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/10145 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/29546#comment:3>

Django

unread,
Jul 7, 2018, 6:49:32 PM7/7/18
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: assigned
Component: Utilities | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (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.

--
Ticket URL: <https://code.djangoproject.com/ticket/29546#comment:4>

Django

unread,
Jul 9, 2018, 4:34:07 PM7/9/18
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: closed
Component: Utilities | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"338f741c5eb6b91118f6a6b7c34b5e9b47a5661d" 338f741]:
{{{
#!CommitTicketReference repository=""
revision="338f741c5eb6b91118f6a6b7c34b5e9b47a5661d"
Fixed #29546 -- Deprecated django.utils.timezone.FixedOffset.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29546#comment:5>

Django

unread,
Sep 10, 2019, 6:19:58 AM9/10/19
to django-...@googlegroups.com
#29546: deprecate timezone.FixedOffset in favor of datetime.timezone
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Sergey
Type: | Fedoseev
Cleanup/optimization | Status: closed
Component: Utilities | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"cb2be9d5d57c34a70f0c549b780183f8c73aec4b" cb2be9d5]:
{{{
#!CommitTicketReference repository=""
revision="cb2be9d5d57c34a70f0c549b780183f8c73aec4b"
Refs #29546 -- Removed django.utils.timezone.FixedOffset per deprecation
timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29546#comment:6>

Reply all
Reply to author
Forward
0 new messages