Update imaplib2 to 2.37

The only fix is
 - add missing idle_lock in _handler().

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
Eygene Ryabinkin 2014-10-10 16:23:07 +04:00
parent 1901e81557
commit 3d88a76959
2 changed files with 20 additions and 12 deletions

View File

@ -8,6 +8,9 @@ ChangeLog
OfflineIMAP v6.5.6.1 (YYYY-MM-DD) 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 * Added default CA bundle location for OpenBSD
(GitHub pull #120) and DragonFlyBSD. (GitHub pull #120) and DragonFlyBSD.

View File

@ -17,9 +17,9 @@ Public functions: Internaldate2Time
__all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream", __all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream",
"Internaldate2Time", "ParseFlags", "Time2Internaldate") "Internaldate2Time", "ParseFlags", "Time2Internaldate")
__version__ = "2.36" __version__ = "2.37"
__release__ = "2" __release__ = "2"
__revision__ = "36" __revision__ = "37"
__credits__ = """ __credits__ = """
Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998. Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
String method conversion by ESR, February 2001. 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 <vladimir.marek@oracle.com> August 2011. Single quoting introduced with the help of Vladimir Marek <vladimir.marek@oracle.com> August 2011.
Support for specifying SSL version by Ryan Kavanagh <rak@debian.org> July 2013. Support for specifying SSL version by Ryan Kavanagh <rak@debian.org> July 2013.
Fix for gmail "read 0" error provided by Jim Greenleaf <james.a.greenleaf@gmail.com> August 2013. Fix for gmail "read 0" error provided by Jim Greenleaf <james.a.greenleaf@gmail.com> August 2013.
Fix for offlineimap "indexerror: string index out of range" bug provided by Eygene Ryabinkin <rea@codelabs.ru> August 2013.""" Fix for offlineimap "indexerror: string index out of range" bug provided by Eygene Ryabinkin <rea@codelabs.ru> August 2013.
Fix for missing idle_lock in _handler() provided by Franklin Brook <franklin@brook.se> August 2014"""
__author__ = "Piers Lauder <piers@janeelix.com>" __author__ = "Piers Lauder <piers@janeelix.com>"
__URL__ = "http://imaplib2.sourceforge.net" __URL__ = "http://imaplib2.sourceforge.net"
__license__ = "Python License" __license__ = "Python License"
@ -1663,7 +1664,8 @@ class IMAP4(object):
typ, val = self.abort, 'connection terminated' typ, val = self.abort, 'connection terminated'
while not self.Terminate: while not self.Terminate:
try:
self.idle_lock.acquire()
if self.idle_timeout is not None: if self.idle_timeout is not None:
timeout = self.idle_timeout - time.time() timeout = self.idle_timeout - time.time()
if timeout <= 0: if timeout <= 0:
@ -1673,6 +1675,9 @@ class IMAP4(object):
self._log(5, 'server IDLING, timeout=%.2f' % timeout) self._log(5, 'server IDLING, timeout=%.2f' % timeout)
else: else:
timeout = resp_timeout timeout = resp_timeout
self.idle_lock.release()
try:
line = self.inq.get(True, timeout) line = self.inq.get(True, timeout)
except Queue.Empty: except Queue.Empty:
if self.idle_rqb is None: if self.idle_rqb is None: