diff --git a/Changelog.rst b/Changelog.rst index 66f5c05..cdd871f 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -8,6 +8,9 @@ ChangeLog OfflineIMAP v6.5.6.1 (YYYY-MM-DD) ================================= +* Updated bundled imaplib2 to 2.37: + - add missing idle_lock in _handler() + * Added default CA bundle location for OpenBSD (GitHub pull #120) and DragonFlyBSD. diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py index 14a802b..8921c9d 100644 --- a/offlineimap/imaplib2.py +++ b/offlineimap/imaplib2.py @@ -17,9 +17,9 @@ Public functions: Internaldate2Time __all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream", "Internaldate2Time", "ParseFlags", "Time2Internaldate") -__version__ = "2.36" +__version__ = "2.37" __release__ = "2" -__revision__ = "36" +__revision__ = "37" __credits__ = """ Authentication code contributed by Donn Cave June 1998. String method conversion by ESR, February 2001. @@ -42,7 +42,8 @@ Threads now set the "daemon" flag (suggested by offlineimap-project) April 2011. Single quoting introduced with the help of Vladimir Marek August 2011. Support for specifying SSL version by Ryan Kavanagh July 2013. Fix for gmail "read 0" error provided by Jim Greenleaf August 2013. -Fix for offlineimap "indexerror: string index out of range" bug provided by Eygene Ryabinkin August 2013.""" +Fix for offlineimap "indexerror: string index out of range" bug provided by Eygene Ryabinkin August 2013. +Fix for missing idle_lock in _handler() provided by Franklin Brook August 2014""" __author__ = "Piers Lauder " __URL__ = "http://imaplib2.sourceforge.net" __license__ = "Python License" @@ -1663,16 +1664,20 @@ class IMAP4(object): typ, val = self.abort, 'connection terminated' while not self.Terminate: + + self.idle_lock.acquire() + if self.idle_timeout is not None: + timeout = self.idle_timeout - time.time() + if timeout <= 0: + timeout = 1 + if __debug__: + if self.idle_rqb is not None: + self._log(5, 'server IDLING, timeout=%.2f' % timeout) + else: + timeout = resp_timeout + self.idle_lock.release() + try: - if self.idle_timeout is not None: - timeout = self.idle_timeout - time.time() - if timeout <= 0: - timeout = 1 - if __debug__: - if self.idle_rqb is not None: - self._log(5, 'server IDLING, timeout=%.2f' % timeout) - else: - timeout = resp_timeout line = self.inq.get(True, timeout) except Queue.Empty: if self.idle_rqb is None: