sqlite3 doesn't raise exception if database is not present/inaccessible

Tim Harig usernet at ilthio.net
Sat Nov 13 18:17:22 CET 2010

On 2010-11-13, Ravi <ra.ravi.rav at gmail.com> wrote:
> import sqlite3
> con = sqlite3.connect("any string here")

That is a property of the sqlite database itself.  It always opens the
database requested; even if it has to create a new database to do so.

> and there is no error reported. You will get an error you do some

If you are conserned about it, check that the database contains the schema
that you were expecting before trying any other operations on it.

> operations on the database which is confusing. I think sqlite3 should
> change this behavior.

If you believe that, you should talk to the sqlite3 people since this is a
property of the database rather then a Python issue.

More information about the Python-list mailing list