mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix for issue 5259: ASCII encode the username and password before passing
it to encode_base64, which requires bytes in py3k. Fix by Musashi Tamura, tests by Marcin Bachry.
This commit is contained in:
parent
dfea192ad4
commit
caa27b7823
4 changed files with 26 additions and 1 deletions
|
@ -545,7 +545,8 @@ class SMTP:
|
|||
return encode_base64(response)
|
||||
|
||||
def encode_plain(user, password):
|
||||
return encode_base64("\0%s\0%s" % (user, password))
|
||||
s = "\0%s\0%s" % (user, password)
|
||||
return encode_base64(s.encode('ascii'), eol='')
|
||||
|
||||
|
||||
AUTH_PLAIN = "PLAIN"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue