[Django] #25466: django.template.loader.LoaderOrigin was removed without proper deprecation

13 views
Skip to first unread message

Django

unread,
Sep 25, 2015, 1:35:18 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+--------------------
Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
https://code.djangoproject.com/ticket/15053 caused the removal of
django.template.loader.LoadOrigin (and django.template.StringOrigin), in
favor of django.template.base.Origin, for Django 1.9.

These APIs were new and documented as of Django 1.7:
https://docs.djangoproject.com/en/1.7/ref/templates/api/#template-origin

Even in the 1.8 branch, there is no DeprecationWarning for this class:
https://github.com/django/django/blob/stable/1.8.x/django/template/loader.py#L14

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

Django

unread,
Sep 25, 2015, 1:36:17 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+--------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 apollo13):

* cc: apollo13 (added)
* needs_better_patch: => 0
* severity: Normal => Release blocker
* needs_tests: => 0
* needs_docs: => 0


Comment:

If possible we should restore the old aliases, after all this is a
regression.

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

Django

unread,
Sep 25, 2015, 1:37:56 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 apollo13):

* stage: Unreviewed => Accepted


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

Django

unread,
Sep 25, 2015, 2:54:29 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Old description:

> https://code.djangoproject.com/ticket/15053 caused the removal of
> django.template.loader.LoadOrigin (and django.template.StringOrigin), in
> favor of django.template.base.Origin, for Django 1.9.
>
> These APIs were new and documented as of Django 1.7:
> https://docs.djangoproject.com/en/1.7/ref/templates/api/#template-origin
>
> Even in the 1.8 branch, there is no DeprecationWarning for this class:
> https://github.com/django/django/blob/stable/1.8.x/django/template/loader.py#L14

New description:

#15053 caused the removal of `django.template.loader.LoadOrigin` (and
`django.template.StringOrigin`), in favor of
`django.template.base.Origin`, for Django 1.9.

These APIs were new and documented as of Django 1.7:
https://docs.djangoproject.com/en/1.7/ref/templates/api/#template-origin

Even in the 1.8 branch, there is no DeprecationWarning for this class:
https://github.com/django/django/blob/stable/1.8.x/django/template/loader.py#L14

--

Comment (by timgraham):

May I ask about the use case so we can be sure to solve the issue
appropriately? Thanks.

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

Django

unread,
Sep 25, 2015, 3:11:02 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by tarkatronic):

The case where I found it was in
https://github.com/opbeat/opbeat_python/blob/131ecaa4829fa3155020e3f2c39c382fd1f8a08e/opbeat/contrib/django/client.py#L148.
According to piquadrat, in #django:
< piquadrat> TheJoey: yep, that's probably the way it'll go. BTW,
generally speaking, the change that introduced this is actually great for
Opbeat because we now have the template name and can show you the template
in the stack trace

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

Django

unread,
Sep 25, 2015, 4:11:05 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 timgraham):

* Attachment "25466-aliases.diff" added.

Django

unread,
Sep 25, 2015, 4:12:16 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by timgraham):

Would the attached patch solve your issue? A formal deprecation doesn't
seem possible since you don't instantiate the class.

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

Django

unread,
Sep 25, 2015, 5:22:15 PM9/25/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------

Comment (by piquadrat):

In the case of opbeat_python, it would solve the problem, but we anyway
intend to use the `Origin` class when available.

I searched github for `LoaderOrigin`, there are a few occurrences, most
prominently raven-python (Sentry), which is already updated to work with
1.9a1.

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

Django

unread,
Sep 26, 2015, 2:10:33 PM9/26/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------

Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 timgraham):

* has_patch: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/25466#comment:7>

Django

unread,
Sep 29, 2015, 7:07:08 PM9/29/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------
Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 1.9a1
Severity: Release blocker | 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: new => closed
* resolution: => fixed


Comment:

In [changeset:"8d1a001ef6dcbbe8053da05cdb3ec99965b0953f" 8d1a001]:
{{{
#!CommitTicketReference repository=""
revision="8d1a001ef6dcbbe8053da05cdb3ec99965b0953f"
Fixed #25466 -- Added backwards compatibility aliases for LoaderOrigin and
StringOrigin.

Thanks Simon Charette for the DeprecationInstanceCheck class.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25466#comment:8>

Django

unread,
Sep 29, 2015, 7:20:56 PM9/29/15
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------
Reporter: tarkatronic | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 Tim Graham <timograham@…>):

In [changeset:"59027a4cae8c5abbd0e9308d95dd6608be9199cd" 59027a4c]:
{{{
#!CommitTicketReference repository=""
revision="59027a4cae8c5abbd0e9308d95dd6608be9199cd"
[1.9.x] Fixed #25466 -- Added backwards compatibility aliases for
LoaderOrigin and StringOrigin.

Thanks Simon Charette for the DeprecationInstanceCheck class.

Backport of 8d1a001ef6dcbbe8053da05cdb3ec99965b0953f from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25466#comment:9>

Django

unread,
Jan 17, 2017, 10:09:51 PM1/17/17
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------
Reporter: Joey Wilhelm | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 Tim Graham <timograham@…>):

In [changeset:"ff419de263138e905dff44c5cb806310c70f32aa" ff419de2]:
{{{
#!CommitTicketReference repository=""
revision="ff419de263138e905dff44c5cb806310c70f32aa"
Refs #25466 -- Removed aliases for LoaderOrigin and StringOrigin.

Per deprecation timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25466#comment:10>

Django

unread,
Jul 11, 2024, 3:40:18 AM7/11/24
to django-...@googlegroups.com
#25466: django.template.loader.LoaderOrigin was removed without proper deprecation
---------------------------------+------------------------------------
Reporter: Joey Wilhelm | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 1.9a1
Severity: Release blocker | 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 Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"86e13843c2ab510fba1de84588efe7fd03555531" 86e13843]:
{{{#!CommitTicketReference repository=""
revision="86e13843c2ab510fba1de84588efe7fd03555531"
Refs #25466 -- Removed unused DeprecationInstanceCheck.

Unused since ff419de263138e905dff44c5cb806310c70f32aa.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25466#comment:11>
Reply all
Reply to author
Forward
0 new messages