Pathetic Python Blogging: SQL Bug?

I have a curious problem with Python 2.5’s SQL support. OK, so we import sqlite3 and create a connection object to an existing sql file. It happens. Then we call the connection’s cursor method. OK.

Now, if you look up the sqlite documentation, the most important command is cursor.execute(), where your SQL command goes in the brackets as a triple-quoted multiline statement. Having done your SELECT FROM or whatever, you get back a result set object which you can either fetch bits from with the cursor’s fetch() method or iterate through in a loop of some kind.

But I can’t find any documentation for the case when you get back an AttributeError saying that the method cursor doesn’t have an attribute called ‘execute’. WTF? Can anyone explain this?

Bonus Pathetic: Offtopic, I was recently looking something up on the mod_python documentation site when I noticed a GoogleAd eyeing me – “Hacking All Day Won’t Get You A Girlfriend! Don’t Let Time Pass -” and then the URL of a dating agency. Made me laugh, at least.

Update: Woo. Incredibly pathetic error…

2 Comments on "Pathetic Python Blogging: SQL Bug?"

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.