In article <[email protected]>, "Gabriel Genellina" <[email protected]> wrote:
> En Mon, 02 Feb 2009 06:59:16 -0200, Ron Garret <[email protected]> > escribió: > > > I'm running the following WSGI app under Yaro: > > > > def error(req): > > try: > > req.non_existent_key > > except: > > try: > > return cgitb.html(sys.exc_info()) > > except: > > return 'foo' > > > > The result of running this is 'foo'. In other words, the reference to > > the non-existent key generates an exception as expected, but then the > > generation of the traceback generates ANOTHER exception, which I would > > not have expected. If I add another TRY/EXCEPT block to capture this > > exception, the result is attached at the bottom of this message. > > Unqualified excepts are evil -- see this recent post (mine) > http://groups.google.com/group/comp.lang.python/msg/05e822f694b6421c > > But in this case you hit a known bug in cgitb - see > http://bugs.python.org/issue4643 for a solution. Aha! Thank you! That explains everything, except this: why does the problem go away when I run under wsgiref and capture the request in a global variable? Feel free to treat that as a rhetorical question :) rg
-- http://mail.python.org/mailman/listinfo/python-list
