quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Pederson ...@barryp.org>
Subject tableobject - SystemError: error return without exception set
Date Sun, 08 Jun 2003 17:16:50 GMT
I was trying to use mod_python 3.0.3 with SimpleTAL (3.2), and found 
that when trying to access req.headers_in through a TALES expression, 
mod_python would fail with:

    SystemError: error return without exception set

and afterwards become unusable, requiring an apache restart.

Turns out SimpleTAL is using unicode, and the check in 
tableobject.c::table_has_key() is not setting an exception like it should.

An easy non-SimpleTAL way to see the problem is to use the mod_python 
publisher with something like:

    def index(req):
         return req.headers_in.has_key(u'foo')

I've attached a small patch to fix this one particular problem - but 
browsing through tableobject.c it looks like there are quite a few 
places where NULL is returned without an exception being set that may be 

Also, SimpleTAL still doesn't work for accessing req.headers_in because 
of the unicode, but at least the error will be

    TypeError: table keys must be strings

and leaves mod_python less freaked-out.  I'll be willing to work on more 
cleanups if necessary - but I thought I'd bring this up first and see if 
anyone's paying attention to this list.


(BTW...is there an archive for this mailing list?  an bug database?)

View raw message