Fix mbox.select(foldername) readonly parameter comparison
The default parameter value was "None", and we were comparing that directly to the imaplib2 value of is_readonly which is False or True, so the comparison always returned "False". Fix this by setting the default parameter to "False" and not "None". Also convert all users of that function to use False/True. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
@ -54,7 +54,7 @@ class IMAPFolder(BaseFolder):
|
||||
try:
|
||||
imapobj.select(self.getfullname())
|
||||
except imapobj.readonly:
|
||||
imapobj.select(self.getfullname(), readonly = 1)
|
||||
imapobj.select(self.getfullname(), readonly = True)
|
||||
|
||||
def suggeststhreads(self):
|
||||
return 1
|
||||
@ -204,7 +204,7 @@ class IMAPFolder(BaseFolder):
|
||||
fails_left = 2 # retry on dropped connection
|
||||
while fails_left:
|
||||
try:
|
||||
imapobj.select(self.getfullname(), readonly = 1)
|
||||
imapobj.select(self.getfullname(), readonly = True)
|
||||
res_type, data = imapobj.uid('fetch', str(uid),
|
||||
'(BODY.PEEK[])')
|
||||
fails_left = 0
|
||||
|
Reference in New Issue
Block a user