[issue5304] email/base64mime.py cannot work

l5g report at bugs.python.org
Wed Feb 18 02:36:07 CET 2009


New submission from l5g <80723567 at qq.com>:

When using smtplib to send mail, I meet this bug. Maybe the line
              """ enc = b2a_base64(s[i:i +
max_unencoded]).decode("ascii")""" 
should be changed to
               """ enc = b2a_base64((s[i:i +
max_unencoded]).encode()).decode("ascii")

File "/usr/local/lib/python3.0/smtplib.py", line 580, in login
    AUTH_PLAIN + " " + encode_plain(user, password))
  File "/usr/local/lib/python3.0/smtplib.py", line 545, in encode_plain
    return encode_base64("\0%s\0%s" % (user, password))
  File "/usr/local/lib/python3.0/email/base64mime.py", line 97, in
body_encode
    enc = b2a_base64(s[i:i + max_unencoded]).decode("ascii")
TypeError: b2a_base64() argument 1 must be bytes or buffer, not str

----------
messages: 82400
nosy: l5g
severity: normal
status: open
title: email/base64mime.py cannot work
type: compile error
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5304>
_______________________________________


More information about the Python-bugs-list mailing list