Message239283
If the authenticator object passed to the IMAP authenticate method tries to abort the handshake by returning None, TypeError is raised instead of sending the * line to the server.
>>> import imaplib
>>> imap = imaplib.IMAP4_SSL('imap.gmail.com')
>>> imap.authenticate(b'PLAIN', lambda x: None)
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
imap.authenticate(b'PLAIN', lambda x: None)
File "C:\Python34\lib\imaplib.py", line 380, in authenticate
typ, dat = self._simple_command('AUTHENTICATE', mech)
File "C:\Python34\lib\imaplib.py", line 1133, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "C:\Python34\lib\imaplib.py", line 940, in _command
self.send(literal)
File "C:\Python34\lib\imaplib.py", line 276, in send
self.sock.sendall(data)
File "C:\Python34\lib\ssl.py", line 723, in sendall
v = self.send(data[count:])
File "C:\Python34\lib\ssl.py", line 684, in send
v = self._sslobj.write(data)
TypeError: 'str' does not support the buffer interface
The problem is that _Authenticator.process returns a string instead of bytes in this case. |
|
Date |
User |
Action |
Args |
2015-03-25 22:21:23 | craigh | set | recipients:
+ craigh |
2015-03-25 22:21:23 | craigh | set | messageid: <1427322083.72.0.863898159285.issue23779@psf.upfronthosting.co.za> |
2015-03-25 22:21:23 | craigh | link | issue23779 messages |
2015-03-25 22:21:23 | craigh | create | |
|