From 3a5becf6a75f58fa43d396164561739e86bcb34e Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Sat, 11 Jun 2016 11:08:02 +0200 Subject: [PATCH] bump from imaplib2 v2.53 to v2.55 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Expose more literals. - Fix a type to bytes. - Fix comment. Changes submitted upstream by Ɓukasz and me. Signed-off-by: Nicolas Sebrecht --- README.md | 2 +- offlineimap/bundled_imaplib2.py | 14 +++++++++----- offlineimap/virtual_imaplib2.py | 12 ++++++------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2e2dd1a..4b2f221 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Bugs, issues and contributions can be requested to both the mailing list or the * Python v2.7+ * Python v3.4+ ***(experimental)*** * six (required) -* imaplib2 >= 2.53 (optional) +* imaplib2 >= 2.55 (optional) ## Documentation diff --git a/offlineimap/bundled_imaplib2.py b/offlineimap/bundled_imaplib2.py index bbddd55..d705021 100755 --- a/offlineimap/bundled_imaplib2.py +++ b/offlineimap/bundled_imaplib2.py @@ -15,11 +15,12 @@ Public functions: Internaldate2Time __all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream", - "Internaldate2Time", "ParseFlags", "Time2Internaldate") + "Internaldate2Time", "ParseFlags", "Time2Internaldate", + "Mon2num", "MonthNames", "InternalDate") -__version__ = "2.53" +__version__ = "2.55" __release__ = "2" -__revision__ = "53" +__revision__ = "55" __credits__ = """ Authentication code contributed by Donn Cave June 1998. String method conversion by ESR, February 2001. @@ -484,7 +485,7 @@ class IMAP4(object): import ssl TLS_MAP = {} - if hasattr(ssl, "PROTOCOL_TLSv1_2"): # py3 + if hasattr(ssl, "PROTOCOL_TLSv1_2"): TLS_MAP[TLS_SECURE] = { "tls1_2": ssl.PROTOCOL_TLSv1_2, "tls1_1": ssl.PROTOCOL_TLSv1_1, @@ -2293,7 +2294,10 @@ class _Authenticator(object): # so when it gets to the end of the 8-bit input # there's no partial 6-bit output. # - oup = '' + if bytes != str: + oup = b'' + else: + oup = '' while inp: if len(inp) > 48: t = inp[:48] diff --git a/offlineimap/virtual_imaplib2.py b/offlineimap/virtual_imaplib2.py index 3ab1638..44f3409 100644 --- a/offlineimap/virtual_imaplib2.py +++ b/offlineimap/virtual_imaplib2.py @@ -25,7 +25,7 @@ this virtual_imaplib2 or we might go into troubles. DESC = None _SUPPORTED_RELEASE = 2 -_SUPPORTED_REVISION = 53 +_SUPPORTED_REVISION = 55 try: # Try any imaplib2 in PYTHONPATH first. This allows both maintainers of @@ -42,14 +42,14 @@ except (ImportError, NameError) as e: try: from offlineimap.bundled_imaplib2 import * import offlineimap.bundled_imaplib2 as imaplib + DESC = "bundled" except: print("Error while trying to import system imaplib2: %s"% e) raise -# We should really get those literals exposed by upstream. Same goes for -# __version__, __release__ and __revision__. -InternalDate = imaplib.InternalDate -Mon2num = imaplib.Mon2num -MonthNames = imaplib.MonthNames +# Upstream won't expose those literals to avoid erasing them with "import *" in +# case they exist. __version__ = imaplib.__version__ +__release__ = imaplib.__release__ +__revision__ = imaplib.__revision__