#16935: Misleading message 'super object has no attribute __getattr__' on
AttributError during SimpleTemplateResponse.render
-----------------------+---------------------------------
Reporter: isagalaev | Owner: isagalaev
Type: Bug | Status: new
Milestone: | Component: Template system
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------+---------------------------------
Consider this code:
{{{
from django.template import Template
from django.template.response import SimpleTemplateResponse
class A(object):
def __unicode__(self):
return None.something
def index(request):
return SimpleTemplateResponse(Template('{{ var }}'), {'var': A()})
}}}
This code emulates a situation of any {{{AttributeError}}} raised during
initial template rendering from within {{{SimpleTemplateReponse.render}}}.
The real error "NoneType object has no attribute something" is masked by a
very weird-looking "super object has no attribute __getattr__". The
traceback also points inside SimpleTemplateResponse.__getattr__ which has
no relation whatsoever to the real point of error.
--
Ticket URL: <https://code.djangoproject.com/ticket/16935>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.