From 04babea60735c489a88548a4d3625e2a96fa88fb Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Thu, 5 Nov 2015 09:07:31 +0100 Subject: [PATCH] bump from imaplib2 v2.51 to v2.52 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks-to: Sébastien Gross Signed-off-by: Nicolas Sebrecht --- offlineimap/imaplib2.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) mode change 100644 => 100755 offlineimap/imaplib2.py diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py old mode 100644 new mode 100755 index be3a7b4..61878f6 --- 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.51" +__version__ = "2.52" __release__ = "2" -__revision__ = "51" +__revision__ = "52" __credits__ = """ Authentication code contributed by Donn Cave June 1998. String method conversion by ESR, February 2001. @@ -50,7 +50,8 @@ Fix for null strings appended to untagged responses by Pierre-Louis Bonicoli August 2015. Fix to allow interruptible IDLE command by Tim Peoples September 2015. -Add support for TLS levels by Ben Boeckel September 2015.""" +Add support for TLS levels by Ben Boeckel September 2015. +Fix for shutown exception by Sebastien Gross November 2015.""" __author__ = "Piers Lauder " __URL__ = "http://imaplib2.sourceforge.net" __license__ = "Python License" @@ -579,7 +580,7 @@ class IMAP4(object): try: self.sock.shutdown(socket.SHUT_RDWR) - except OSError as e: + except Exception as e: # The server might already have closed the connection if e.errno != errno.ENOTCONN: raise @@ -1349,8 +1350,8 @@ class IMAP4(object): if self.state not in Commands[name][CMD_VAL_STATES]: self.literal = None - raise self.error('command %s illegal in state %s' - % (name, self.state)) + raise self.error('command %s illegal in state %s, only allowed in states %s' + % (name, self.state, ', '.join(Commands[name][CMD_VAL_STATES]))) self._check_bye()