bump from imaplib2 v2.53 to v2.55

- Expose more literals.
- Fix a type to bytes.
- Fix comment.

Changes submitted upstream by Łukasz and me.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-06-11 11:08:02 +02:00
parent cdfa75f72d
commit 3a5becf6a7
3 changed files with 16 additions and 12 deletions

View File

@ -83,7 +83,7 @@ Bugs, issues and contributions can be requested to both the mailing list or the
* Python v2.7+ * Python v2.7+
* Python v3.4+ ***(experimental)*** * Python v3.4+ ***(experimental)***
* six (required) * six (required)
* imaplib2 >= 2.53 (optional) * imaplib2 >= 2.55 (optional)
## Documentation ## Documentation

View File

@ -15,11 +15,12 @@ Public functions: Internaldate2Time
__all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream", __all__ = ("IMAP4", "IMAP4_SSL", "IMAP4_stream",
"Internaldate2Time", "ParseFlags", "Time2Internaldate") "Internaldate2Time", "ParseFlags", "Time2Internaldate",
"Mon2num", "MonthNames", "InternalDate")
__version__ = "2.53" __version__ = "2.55"
__release__ = "2" __release__ = "2"
__revision__ = "53" __revision__ = "55"
__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.
@ -484,7 +485,7 @@ class IMAP4(object):
import ssl import ssl
TLS_MAP = {} TLS_MAP = {}
if hasattr(ssl, "PROTOCOL_TLSv1_2"): # py3 if hasattr(ssl, "PROTOCOL_TLSv1_2"):
TLS_MAP[TLS_SECURE] = { TLS_MAP[TLS_SECURE] = {
"tls1_2": ssl.PROTOCOL_TLSv1_2, "tls1_2": ssl.PROTOCOL_TLSv1_2,
"tls1_1": ssl.PROTOCOL_TLSv1_1, "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 # so when it gets to the end of the 8-bit input
# there's no partial 6-bit output. # there's no partial 6-bit output.
# #
oup = '' if bytes != str:
oup = b''
else:
oup = ''
while inp: while inp:
if len(inp) > 48: if len(inp) > 48:
t = inp[:48] t = inp[:48]

View File

@ -25,7 +25,7 @@ this virtual_imaplib2 or we might go into troubles.
DESC = None DESC = None
_SUPPORTED_RELEASE = 2 _SUPPORTED_RELEASE = 2
_SUPPORTED_REVISION = 53 _SUPPORTED_REVISION = 55
try: try:
# Try any imaplib2 in PYTHONPATH first. This allows both maintainers of # Try any imaplib2 in PYTHONPATH first. This allows both maintainers of
@ -42,14 +42,14 @@ except (ImportError, NameError) as e:
try: try:
from offlineimap.bundled_imaplib2 import * from offlineimap.bundled_imaplib2 import *
import offlineimap.bundled_imaplib2 as imaplib import offlineimap.bundled_imaplib2 as imaplib
DESC = "bundled" DESC = "bundled"
except: except:
print("Error while trying to import system imaplib2: %s"% e) print("Error while trying to import system imaplib2: %s"% e)
raise raise
# We should really get those literals exposed by upstream. Same goes for # Upstream won't expose those literals to avoid erasing them with "import *" in
# __version__, __release__ and __revision__. # case they exist.
InternalDate = imaplib.InternalDate
Mon2num = imaplib.Mon2num
MonthNames = imaplib.MonthNames
__version__ = imaplib.__version__ __version__ = imaplib.__version__
__release__ = imaplib.__release__
__revision__ = imaplib.__revision__