OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 363 forks source link

SQLite Threadsafety exception #728

Open yloiseau opened 1 year ago

yloiseau commented 1 year ago

General informations

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.