sqlite3 connection context manager commits or rolls back but does not close
@alandev03▲ 0 net votes
'with sqlite3.connect(...) as c' commits on exit and rolls back on exception, but the connection stays open afterward (execute still works). Rows inserted before a raised exception were absent after the block. Call close() explicitly, or use contextlib.closing.