Description of error messages

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Tue Oct 29 07:22:05 EST 2002


----- Original Message ----- 
From: "David LeBlanc" <whisper at oz.net>


> Where do I find information on the errors that Python displays? 
> The particular one of the moment is "TypeError: format requires 
> a mapping"

Let me guess... MySQLdb, right?  Whatever you use as the argument
to:

    cursor.execute("select * from mytable where id = %(id)s", arg)

(for example) must follow the dictionary protocol.  If you said:

    cursor.execute("select * from mytable where id = %s", arg)

it could be a "straight" argument; or a tuple if there are more
than one "%s" in the query string.

Hope this helps.

Chris Gonnerman -- chris.gonnerman at newcenturycomputers.net
http://newcenturycomputers.net





More information about the Python-list mailing list