[mod_python] "TypeError: argument 2 must be a mapping" and other things

David Badawi davidbadawi at yahoo.com
Tue Sep 20 17:56:09 EDT 2005


how about acl.execute("SELECT * FROM acl WHERE c = %s
AND d
 = %s;" % (cID, dID))???

--- Daniel Winkler <mailings at danielwinkler.de> wrote:

> Hello together,
> 
> I am trying to write a little web application with
> Apache2, mod_python
> and MySQL. Unfortunately I have to fight with some
> strange effects:
> 
> E.g.:
>   acl = db.cursor()
>   acl.execute("SELECT * FROM acl WHERE c = %s AND d
> = %s;",
>               (cID, dID))
> with cID and dID as integers causes an "TypeError:
> argument 2 must be a
> mapping". Sometimes. I tried to restart the apache
> server and -- it
> worked, but after reloading the SAME page without
> any modifications this
> error occured again, also on similar SQL statements
> in other parts of
> the code.
> I already checked the arguments: They are just
> normal integers.
> I tested the code with the interactive interface:
> everything worked
> fine. (the code sniplet mentioned above is
> independet from Apache and
> special mod_python features)
> 
> Could someone please give me a hint how to debug
> this and to avoid these
> (non-deterministic) errors? What might I have done
> wrong?
> 
> 
> TIA
> Daniel Winkler
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
>
http://mailman.modpython.org/mailman/listinfo/mod_python
> 



More information about the Mod_python mailing list