a client of mine was having a strange bug with the caching template
loader, which we've yet to identify, but as I was looking at the code, I
saw the following:
def load_template(self, template_name, template_dirs=None):
key = self.cache_key(template_name, template_dirs)
template_tuple = self.template_cache.get(key)
# A cached previous failure:
if template_tuple is TemplateDoesNotExist:
elif template_tuple is None:
template, origin = self.find_template(template_name,
if not hasattr(template, 'render'):
template = Template(template, origin,
# If compiling the template we found raises
# back off to returning the source and display name
for the template
# we were asked to load. This allows for correct
# of the actual template that does not exist.
self.template_cache[key] = (template, origin)
self.template_cache[key] = (template, None)
Now... in that "except" clause at the end, it updates the cache dict
with (template, origin).. only then to fall through to set it AGAIN
_immediately_.... with (template, None)
Surely this is wrong one way or the other?
You received this message because you are subscribed to the Google Groups "Django
developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.