[Django] #33519: include X in X leads to silent crash

17 views
Skip to first unread message

Django

unread,
Feb 17, 2022, 5:38:33 AM2/17/22
to django-...@googlegroups.com
#33519: include X in X leads to silent crash
-------------------------------------+-------------------------------------
Reporter: Brambor | Owner: nobody
Type: | Status: new
Uncategorized |
Component: Core | Version: 3.2
(Management commands) | Keywords: template include
Severity: Normal | crash
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
index.html
{{{
{% load static %}

{% include "index.html" %}
}}}

view:
{{{
def index(request, **kwargs):
template = loader.get_template('index.html')

return HttpResponse(template.render({}, request))
}}}

`url(r'^index$', index)` is in urlpatterns in urls.py

When running the server with
`python manage.py runserver`
and accessing `http://localhost:8000/index`
The server just stops, not printing anything

cmd line looks like this:
{{{
>>>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
February 17, 2022 - 11:33:10
Django version 3.2.12, using settings 'settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

>>>
}}}

I also tried `python manage.py runserver -v 3`, which too didn't print
anything.

If I have seen a simple "Ran out of memory" Exception or something, it
would occur to me that I did include X in X. Without that error message, I
wondered, whether the issue is that something is called `index` and that
word is reserved somewhere.

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

Django

unread,
Feb 17, 2022, 7:20:20 AM2/17/22
to django-...@googlegroups.com
#33519: Recursive {% include %} crashes silently.

-------------------------------------+-------------------------------------
Reporter: Brambor | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 3.2
Severity: Normal | Resolution: wontfix
Keywords: template include | Triage Stage:
crash | Unreviewed
Has patch: 0 | Needs documentation: 0

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

* status: new => closed
* resolution: => wontfix
* type: Uncategorized => Bug
* component: Core (Management commands) => Template system


Comment:

Thanks for the report. On Django 4.0 it crashes with `RecursionError:
maximum recursion depth exceeded` and on Django 3.2 it crashes with:
{{{
Fatal Python error: Cannot recover from stack overflow.
Python runtime state: initialized

Current thread 0x00007f8e7a566700 (most recent call first):
....
}}}
It seems to have been accidentally improved in
854e9b066850b9b4eb1171966e996322b2c16d27. Unfortunately, Django 3.2 is in
extended support and doesn't receive bugfixes anymore (except security
issues and data loss bugs).

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

Reply all
Reply to author
Forward
0 new messages