Message150500
In Python 2.6 PLAIN authentication works, in Python 3.1 not. Lib/test/test_imaplib.py does not test IMAP4.authenticate() or IMAP4.login_cram_md5() functions, only IMAP4.login(). I would still like to go back to imaplib._Authenticator.encode() function. The function is below. # inp = authobject(response) def encode(self, inp): oup = '' while inp: if len(inp) > 48: t = inp[:48] inp = inp[48:] else: t = inp inp = '' e = binascii.b2a_base64(t) if e: oup = oup + e[:-1] return oup binascii.b2a_base64() takes bytes, so inp must therefore be bytes, and returns bytes (Python 3). Then str + bytes (out + e[:-1]) fails. The fix would then be changing oup = oup + e[:-1] to oup = oup + e[:-1].decode() | |
| Date | User | Action | Args | | 2012-01-03 15:06:16 | etukia | set | recipients: + etukia, r.david.murray, docs@python | | 2012-01-03 15:06:16 | etukia | set | messageid: <1325603176.26.0.392799478167.issue13700@psf.upfronthosting.co.za> | | 2012-01-03 15:06:15 | etukia | link | issue13700 messages | | 2012-01-03 15:06:15 | etukia | create | | |