Skip to content

smtplib exception smtp.connect TypeError encode_plain #50772

Closed

Description

@kmcguire
mannequin
BPO 6523
Superseder
  • bpo-5259: smtplib is broken in Python3
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-01-09.17:28:58.240>
    created_at = <Date 2009-07-20.06:12:17.858>
    labels = ['type-bug', 'library', 'expert-unicode']
    title = 'smtplib exception smtp.connect TypeError encode_plain'
    updated_at = <Date 2010-01-09.17:28:58.239>
    user = 'https://bugs.python.org/kmcguire'

    bugs.python.org fields:

    activity = <Date 2010-01-09.17:28:58.239>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-01-09.17:28:58.240>
    closer = 'r.david.murray'
    components = ['Library (Lib)', 'Unicode']
    creation = <Date 2009-07-20.06:12:17.858>
    creator = 'kmcguire'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 6523
    keywords = []
    message_count = 1.0
    messages = ['90723']
    nosy_count = 1.0
    nosy_names = ['kmcguire']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '5259'
    type = 'behavior'
    url = 'https://bugs.python.org/issue6523'
    versions = ['Python 3.0']

    Activity

    1. kmcguire commented on Jul 20, 2009

      kmcguiremannequin
      MannequinAuthor

      ------ SYSTEM INFORMATION -----
      module: smtplib
      system: linux

      python3.0 -V
      Python 3.0.1+

      ----- TEST CASE PYTHON SOURCE -----

      import smtplib
      smtp = smtplib.SMTP()
      smtp.connect('mail.myserver.org')
      smtp.login('myusername', 'mypassword')

      ----- TEST CASE EXECUTION RESULTS -----

      python3.0 testcase.py 
      Traceback (most recent call last):
        File "testcase.py", line 4, in <module>
          smtp.login('myusername', 'mypassword')
        File "/home/kevin/Projects/ftpwatch/smtplib.py", line 580, in login
          AUTH_PLAIN + " " + encode_plain(user, password))
        File "/home/kevin/Projects/ftpwatch/smtplib.py", line 545, in encode_plain
          return encode_base64("\0%s\0%s" % (user, password))
        File "/usr/lib/python3.0/email/base64mime.py", line 96, 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
    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Jul 20, 2009
    3. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytopic-unicodetype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions