[pysqlite] again "Unable to close due to unfinalised statements"
Luc Saffre
luc.saffre at gmx.net
Fri Aug 26 16:07:20 CEST 2005
Hello,
I am having again an "OperationalError: Unable to close due to
unfinalised statements", and I don't see how I can avoid it. Here is a
test case which should reproduce the problem (I use pysqlite 2.0.3 on
Win32+Python 2.3).
Any hints?
Luc
import pysqlite2.dbapi2 as sqlite
from unittest import TestCase, main
class Case(TestCase):
def test01(self):
self.assertEqual(sqlite.version,'2.0.3')
conn = sqlite.connect(':memory:')
csr = conn.cursor()
csr.execute("""CREATE TABLE Partners (
id BIGINT,
name VARCHAR(50),
PRIMARY KEY (id)
);""")
csr.execute("""INSERT INTO Partners (id, name)
VALUES ( 2, 'Andreas Arens')""")
csr.execute("""
UPDATE Partners SET name = 'Arens, Andreas'
WHERE id = 2; """)
conn.commit()
conn.close()
if __name__ == '__main__':
main()
More information about the pysqlite
mailing list