Fix getuidvalidity crash (UIDVALIDITY returning None)
Rename getuidvalidity -> get_uidvalidity and cache the IMAP result. 1) Start modernizing our function names using more underscores 2) IMAPs implementation of get_uidvalidity was removing the UIDVALIDITY result from the imaplib2 result stack, so subsequent calls would return "None". As various functions can invoke this, this led to some errors that we avoid by caching the current UIDVALIDITY value in the Folder instance. There are more simplifications and improvements to be made. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
@ -70,7 +70,7 @@ class MachineUI(UIBase):
|
||||
def validityproblem(s, folder):
|
||||
s._printData('validityproblem', "%s\n%s\n%s\n%s" % \
|
||||
(folder.getname(), folder.getrepository().getname(),
|
||||
folder.getsaveduidvalidity(), folder.getuidvalidity()))
|
||||
folder.getsaveduidvalidity(), folder.get_uidvalidity()))
|
||||
|
||||
def connecting(s, hostname, port):
|
||||
s._printData('connecting', "%s\n%s" % (hostname, str(port)))
|
||||
|
@ -309,9 +309,9 @@ class UIBase(object):
|
||||
def validityproblem(self, folder):
|
||||
self.logger.warning("UID validity problem for folder %s (repo %s) "
|
||||
"(saved %d; got %d); skipping it. Please see FAQ "
|
||||
"and manual how to handle this." % \
|
||||
"and manual on how to handle this." % \
|
||||
(folder, folder.getrepository(),
|
||||
folder.getsaveduidvalidity(), folder.getuidvalidity()))
|
||||
folder.getsaveduidvalidity(), folder.get_uidvalidity()))
|
||||
|
||||
def loadmessagelist(self, repos, folder):
|
||||
self.logger.debug("Loading message list for %s[%s]" % (
|
||||
|
Reference in New Issue
Block a user