except KeyError: print("this was not a key error?")

gert gert.cuykens at gmail.com
Sun Oct 11 09:23:50 EDT 2009


On Oct 11, 7:48 am, Michel Alexandre Salim
<michael.silva... at gmail.com> wrote:
> On Oct 10, 7:59 pm, gert <gert.cuyk... at gmail.com> wrote:
>
> >http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/order.wsgi
>
> > I screwed up some sql statement
>
> > INSERT INTO orders (pid,uid,bid,time) VALUES (?,?,2,DATETIME('NOW'))",
> > (v['pid']),s.UID)
>
> > bid does not exist anymore, but why does the KeyError exception occur
> > when only my sql statement is wrong ?
>
> Sure it's not from this line?
>
> def stats2(db,v,s): db.execute("SELECT * FROM orders WHERE bid=? AND
> uid=?",(v['bid'],s.UID))
>
> It references v['bid']

Hmm that is also a key error :)



More information about the Python-list mailing list