Re: Silently capturing all UnicodeDecodeError exceptions in widget rendering

2009-02-22 Thread Ben Gerdemann
On Feb 20, 10:52 pm, Malcolm Tredinnick wrote: > Yes. Non-developer-controlled content (which is usually what's being > converted by filters) should not be allowed to crash template rendering. > The data coming into the template variables could be from a lot of > location and, as a final fallba

Re: Silently capturing all UnicodeDecodeError exceptions in widget rendering

2009-02-20 Thread Malcolm Tredinnick
On Fri, 2009-02-20 at 22:22 +0100, Ludvig Ericson wrote: > On Feb 20, 2009, at 20:38, Ben Gerdemann wrote: > > > > > I just spent a good part of my afternoon tracking down a bug in my > > code, that eventually turned out to be a Unicode encoding problem. The > > reason it took me so long to track

Re: Silently capturing all UnicodeDecodeError exceptions in widget rendering

2009-02-20 Thread Malcolm Tredinnick
On Fri, 2009-02-20 at 11:38 -0800, Ben Gerdemann wrote: > I just spent a good part of my afternoon tracking down a bug in my > code, that eventually turned out to be a Unicode encoding problem. The > reason it took me so long to track down the problem is this code here > in 'template/__init__.py':

Re: Silently capturing all UnicodeDecodeError exceptions in widget rendering

2009-02-20 Thread Ludvig Ericson
> On Feb 20, 2009, at 22:22, Ludvig Ericson wrote: >> logger = logging.getLogger("django.template") >> # ... >> try: >> do_whatever() >> except MyError: >> logger. > > How very clever of me to just leave a half-written example... > > logger = logging.getLogger("django.template") >

Re: Silently capturing all UnicodeDecodeError exceptions in widget rendering

2009-02-20 Thread Ludvig Ericson
On Feb 20, 2009, at 20:38, Ben Gerdemann wrote: > > I just spent a good part of my afternoon tracking down a bug in my > code, that eventually turned out to be a Unicode encoding problem. The > reason it took me so long to track down the problem is this code here > in 'template/__init__.py': > >

Silently capturing all UnicodeDecodeError exceptions in widget rendering

2009-02-20 Thread Ben Gerdemann
I just spent a good part of my afternoon tracking down a bug in my code, that eventually turned out to be a Unicode encoding problem. The reason it took me so long to track down the problem is this code here in 'template/__init__.py': 794 class VariableNode(Node): ... 801 def render(s