LocalStatusSQLite: labels: don't fail if database returns unexpected None value

This requires more researches. See
  https://github.com/OfflineIMAP/offlineimap/issues/103
.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht
2015-02-22 14:08:39 +01:00
parent ca06819e70
commit efc4df1bd7
2 changed files with 19 additions and 6 deletions

View File

@ -208,7 +208,7 @@ class MappedIMAPFolder(IMAPFolder):
if uid < 0:
return uid
#if msg uid already exists, just modify the flags
# If msg uid already exists, just modify the flags.
if uid in self.r2l:
self.savemessageflags(uid, flags)
return uid
@ -238,11 +238,10 @@ class MappedIMAPFolder(IMAPFolder):
# Interface from BaseFolder
def savemessageflags(self, uid, flags):
"""
Note that this function does not check against dryrun settings,
"""Note that this function does not check against dryrun settings,
so you need to ensure that it is never called in a
dryrun mode."""
self._mb.savemessageflags(self.r2l[uid], flags)
# Interface from BaseFolder
@ -304,7 +303,7 @@ class MappedIMAPFolder(IMAPFolder):
# Interface from BaseFolder
def deletemessagesflags(self, uidlist, flags):
self._mb.deletemessagesflags(self._uidlist(self.r2l, uidlist),
flags)
flags)
# Interface from BaseFolder
def deletemessage(self, uid):