#26536: Stack overflow in template rendering when using
django.template.loaders.cached.Loader
---------------------------------+--------------------
     Reporter:  andersroos       |      Owner:  nobody
         Type:  Bug              |     Status:  new
    Component:  Template system  |    Version:  1.9
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 If you have two template files with the same name except one is prefixed
 with a dash '-' where one is including the other, you will get a stack
 overflow.

 For example if the main template named {{{example.html}}} looks like this:
 {{{
 {% include '-example.html' %}
 }}}

 This bug is in django.template.loaders.cached.Loader and only happens if
 it is used.

 I believe the bug is caused by the strip('-') when building the cache key
 at {{{django/template/loaders/cached.py:103}}} (in
 {{{Loader.cache_key}}}):
 {{{
     return ("%s-%s-%s" % (template_name, skip_prefix,
 dirs_prefix)).strip('-')
 }}}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.c24df670e66acb47422e92a578ffed6a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to