offlineimap
offlineimap copied to clipboard
SQLite Threadsafety exception
General informations
- system/distribution (with version): Debian 6.0.6-2 (2022-11-01) x86_64 GNU/Linux
- offlineimap version (
offlineimap -V
): offlineimap v8.0.0, imaplib2 v3.05, Python v3.11.1, OpenSSL 3.0.7 1 Nov 2022 - Python version: Python 3.11.1
Logs, error
Establishing connection to ...
ERROR: ERROR in syncfolder for ... folder ...: Traceback (most recent call last):
File "/usr/share/offlineimap3/offlineimap/accounts.py", line 610, in syncfolder
statusfolder.openfiles()
File "/usr/share/offlineimap3/offlineimap/folder/LocalStatusSQLite.py", line 107, in openfiles
assert sqlite.threadsafety == 1, 'Your sqlite is not multithreading safe.'
^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Your sqlite is not multithreading safe.
Your sqlite is not multithreading safe.
Steps to reproduce the error
try to sync.
According to documentation, since python 3.11, the sqlite3.threadsafety
property is defined "dynamically instead of hard-coding it to 1".
On the other hand, the SQLite default for thread safety is SERIALIZED ( see https://www.sqlite.org/threadsafe.html).
The sqlite3.threadsafety
is therefore 3 by default (at least in my distribution).
However, the assertion is for a value of 1, whereas the comment state that it should be SERIALIZED (i.e. 3).
Changed the assert
to > 0
and the sync works fine, but the fix is probably more subtle.