Closed tomhamiltonstubber closed 4 years ago
I also have this issue with Jinja2==2.10.3. With 2.10.1 everyting is ok.
Seeing this too. This is mitigated by https://github.com/django/django/pull/11886 (and you can apply the same try: except IndexError:
patch yourself as a workaround).
This is apparently caused by https://github.com/pallets/jinja/commit/3a86ef3d72fdefb149c0c859e6e37035826f3557 – for some reason the "ugly crap" works, the replaced tb_next
doesn't. I'll look into if it's something we can fix on django-jinja's side here...
More precisely, with the tb_next patch, it looks like exception line numbers are wrong ("line 104 out of 67").
Yeah, since I can't really see any code that would mangle render()
tracebacks in django-jinja, this smells like a Jinja2 regression. Going to report over there :)
It looks like the bug is closed on Jinja's side, and they've released since then as well.
Is it safe to close this issue?
This error happens for Authenticated users, where there's an error in rendering the template.
If I uninstall django-jinja and use jinja templates the way Django recommends in their docs, then I have no issues.
Expected Behaviour
Error renders properly in browser with stacktrace
Actual Behaviour
A server error occurred. Please contact the administrator.
is shown in the browser, and a long stacktrace in the console.Template Code
I created a repo with an easily replicated example:
https://github.com/tomhamiltonstubber/jinja2-error-example
Full Traceback
Your Environment