From 0b824bdc49054f1c651ec2f26ef70497120b9cac Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Thu, 28 Jul 2016 04:06:52 +0200 Subject: [PATCH] offlineimap.conf: allow non-spaces in the account list Commit c992f5853087b pretends to fix this bug it doesn't. Regression introduced in v7.0.0. Github-fix: https://github.com/OfflineIMAP/offlineimap/issues/355 Signed-off-by: Nicolas Sebrecht --- offlineimap/init.py | 2 +- offlineimap/repository/IMAP.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/offlineimap/init.py b/offlineimap/init.py index 639c1b9..db71c54 100644 --- a/offlineimap/init.py +++ b/offlineimap/init.py @@ -379,7 +379,7 @@ class OfflineImap(object): activeaccountnames = self.config.get("general", "accounts") if options.accounts: activeaccountnames = options.accounts - activeaccountnames = activeaccountnames.split(",") + activeaccountnames = [x.lstrip() for x in activeaccountnames.split(",")] allaccounts = accounts.getaccountlist(self.config) for accountname in activeaccountnames: diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index a1fa8ba..17655d5 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -66,13 +66,12 @@ class IMAPRepository(BaseRepository): self.kathread.start() def stopkeepalive(self): - if not hasattr(self, 'kaevent'): - # Keepalive is not active. - return + if self.kaevent is None: + return # Keepalive is not active. self.kaevent.set() - del self.kathread - del self.kaevent + self.kathread = None + self.kaevent = None def holdordropconnections(self): if not self.getholdconnectionopen():