Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-30 Thread Ivan Sagalaev
Though the patch in the ticket does solve the problem I completely agree with removing the code altogether… I'm not a fan of "helpfully" reformulating exceptions while trying to be more specific. In practice it hurts more than it helps, and this case is just another confirmation. -- You receiv

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-30 Thread Jannis Leidel
On 30.09.2011, at 01:58, Luke Plant wrote: > I wrote: > >> and in this case you would instead get >> this message: >> >> "The rendered_content attribute was discarded when this >> TemplateResponse class was pickled." >> >> which is completely false. > > ...which is completely false, so ple

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-30 Thread Florian Apolloner
Hi, On Friday, September 30, 2011 2:22:12 AM UTC+2, Ramiro Morales wrote: > > On Thu, Sep 29, 2011 at 8:43 PM, Luke Plant wrote: > > Hi all, > > > > r16568 [1] added SimpleTemplateResponse.__getattr__ as part of a fix for > > #16326 [2]. > > > > There is one obvious bug in the implementation - it

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-29 Thread Ramiro Morales
On Thu, Sep 29, 2011 at 8:43 PM, Luke Plant wrote: > Hi all, > > r16568 [1] added SimpleTemplateResponse.__getattr__ as part of a fix for > #16326 [2]. > > There is one obvious bug in the implementation - it calls > super(...).__getattr__ which itself raises AttributeError because none > of the ba

Re: __getattr__ on SimpleTemplateResponse causes problems

2011-09-29 Thread Luke Plant
I wrote: > and in this case you would instead get > this message: > > "The rendered_content attribute was discarded when this >TemplateResponse class was pickled." > > which is completely false. ...which is completely false, so please ignore that part :-) The rest of the email was sound t

__getattr__ on SimpleTemplateResponse causes problems

2011-09-29 Thread Luke Plant
Hi all, r16568 [1] added SimpleTemplateResponse.__getattr__ as part of a fix for #16326 [2]. There is one obvious bug in the implementation - it calls super(...).__getattr__ which itself raises AttributeError because none of the base classes have __getattr__. It should use getattr instead. That