piskvorky / sqlitedict

Persistent dict, backed by sqlite3 and pickle, multithread-safe.
Apache License 2.0
1.17k stars 131 forks source link

Python 3.6 support: sqlite3.OperationalError: Safety level may not be changed inside a transaction #58

Closed bit closed 7 years ago

bit commented 7 years ago

fails in python3.6 with

Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File ".../site-packages/sqlitedict.py", line 371, in run cursor.execute('PRAGMA synchronous=OFF') sqlite3.OperationalError: Safety level may not be changed inside a transaction

tmylk commented 7 years ago

How can this be reproduced? It doesn't come up in Travis Python 3.6 tests

bit commented 7 years ago

creating a new instance with autocommit=False triggers this here:

test = SqliteDict(autocommit=False)

bit commented 7 years ago

Looks like travis still does not fail. Even without a new test, make test-all fails here on Arch Linux and Debian/unstable with python3.6 and sqlite 3.16.2

tmylk commented 7 years ago

Let's check sqlite version used in Travis in https://github.com/RaRe-Technologies/sqlitedict/pull/62

tmylk commented 7 years ago

Hmm the sqlite version in travis is really old.

bit commented 7 years ago

Also fails with Ubuntu 17.04 (sqlite 3.15.2). Here a Dockerfile to test with Ubuntu 17.04, possibly something like that can be added to travis

bit commented 7 years ago

Also fails in Ubuntu 16.10 (sqlite 3.14.1 / Python 3.6)