You might want to grab the _sqlite3.py module from the pypy distribution. This is a "native python" implementation of the _sqlite3.pyd extension. It will at least let you know exactly how the python dbapi is implemented using the native SQLite C API. It might help in tracking down the errors -- and it is somewhat easier to understand compared to the C extension code ...
Project: http://www.pypy.org/index.html Source: https://bitbucket.org/pypy/pypy/src/103077d7829d/lib_pypy _sqlite3.py adds an error_code attribute to the exception which is the actual SQLite3 error_code. _sqlite3.pyd does not apper to do so. --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org > -----Original Message----- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of C M > Sent: Sunday, 08 July, 2012 11:23 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] catching sqlite errors...what to know > > Thanks for the help, just getting back now. > > > Your message indicates you are using Python. You should be using > > transactions and context managers. This ensures that things either > > complete or don't, not some half way state. > > I thought SQlite never did anything in a half way state anyway? I > thought that if something failed to be written it was rolled back? > (Pardon if I'm mangling the terminology or misunderstanding it badly). > > > Finally you should have a test suite for your code. The good news is that > > it is fairly easy to cause some of the errors. For example if you would > > like a database to be locked then open it in a new connection and execute > > "BEGIN EXCLUSIVE". > > Any idea how to produce the other errors? Like the Disk I/O error > given by Python's sqlite3 module? > > Thanks again, > Che > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users