]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge: #13700: Make imap.authenticate with authobject work.
authorR David Murray <rdmurray@bitdance.com>
Tue, 19 Feb 2013 17:19:13 +0000 (12:19 -0500)
committerR David Murray <rdmurray@bitdance.com>
Tue, 19 Feb 2013 17:19:13 +0000 (12:19 -0500)
This fixes a bytes/string confusion in the API which prevented
custom authobjects from working at all.

Original patch by Erno Tukia.

1  2 
Doc/library/imaplib.rst
Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/NEWS

Simple merge
diff --cc Lib/imaplib.py
index 3f8c65a98b297266fc7bb27cd849f2b08ba81ad7,00a17fbf36d3de0d7e559a95eb07dd6232639a7b..f8c7ffdb921344b8ec31fa51b16e43f0b505a401
@@@ -1310,11 -1307,13 +1314,11 @@@ class _Authenticator
  
      def decode(self, inp):
          if not inp:
-             return ''
+             return b''
          return binascii.a2b_base64(inp)
  
 -
 -
 -Mon2num = {b'Jan': 1, b'Feb': 2, b'Mar': 3, b'Apr': 4, b'May': 5, b'Jun': 6,
 -           b'Jul': 7, b'Aug': 8, b'Sep': 9, b'Oct': 10, b'Nov': 11, b'Dec': 12}
 +Months = ' Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ')
 +Mon2num = {s.encode():n+1 for n, s in enumerate(Months[1:])}
  
  def Internaldate2tuple(resp):
      """Parse an IMAP4 INTERNALDATE string.
Simple merge
diff --cc Misc/NEWS
Simple merge