#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
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+---------------------------------
Changes (by isagalaev):
* needs_docs: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
It looks like the error is caused by an {{{AttributeError}}} raised while
accessing property {{{SimpleTemplateReponse.rendered_content}}} from with
{{{super(...).__getattr__}}} call. In this case any internal
{{{AttributeError}}} is indistinguishable from the one of absence of the
{{{__getattr__}}} itself.
I've reimplemented the code using {{{__getattribute__}}} that doesn't
introduce this side-effect.
I'm in doubts about tests… Should we really test such a strange corner
case and if yes, how? It seems that the only way is to check for certain
words in an exception message which seems fragile.
--
Ticket URL: <https://code.djangoproject.com/ticket/16935#comment:1>
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.