[pysqlite] apache segfault with mod_python + pysqlite2

Daniel Nogradi nogradi at gmail.com
Mon Jan 23 21:42:18 CET 2006


After changing connection.c, the following code

from pysqlite2 import dbapi2 as sqlite
def index(req):
    con = sqlite.connect( "database.that.exists" )
    con.close()
    return "OK"

if executed through the publisher handler of mod_python gives:



Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in
HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 136,
in handler
    result = util.apply_fs_data(object, req.form, req=req)

  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361, in
apply_fs_data
    return object(**args)

  File "/var/www/html/sokjofoto/sq/python/probi.py", line 7, in index
    con = sqlite.connect( "database.that.exists" )

SystemError: NULL result without error in PyObject_Call



and if instead of database.that.exists there is something that doesn't exist
yet,
then it is created with 0 length but the above error message is the same.
But apache
doesn't crash either way.

I hope this helps, and if you want I can check other things also, but please
reply soon as I'm in an internet cafe at the moment and would leave soon.
Otherwise I could do further checks tomorrow.




Daniel,
>
> please also do me a favour and recompile pysqlite with a small change.
>
> In connection.c in line 84, it reads:
>
>         /* TODO: handle error */
>
> please replace this with:
>
>         return -1;
>
> and try also if it works in mod_python then.
>
> Thanks.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.initd.org/pipermail/pysqlite/attachments/20060123/e60286f7/attachment.html


More information about the Pysqlite mailing list