Skip to content

TypeError: b2a_base64() argument 1 must be bytes or buffer, not str during SMTP.login #50540

Closed

Description

@milivojm
mannequin
BPO 6291
Nosy @bitdancer
Superseder
  • bpo-5259: smtplib is broken in Python3
  • Files
  • test.py: Python example script invoking error
  • 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 2009-06-16.12:59:24.675>
    created_at = <Date 2009-06-16.08:19:53.487>
    labels = ['type-bug', 'library']
    title = 'TypeError: b2a_base64() argument 1 must be bytes or buffer, not str during SMTP.login'
    updated_at = <Date 2009-06-16.12:59:24.646>
    user = 'https://bugs.python.org/milivojm'

    bugs.python.org fields:

    activity = <Date 2009-06-16.12:59:24.646>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-06-16.12:59:24.675>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2009-06-16.08:19:53.487>
    creator = 'milivojm'
    dependencies = []
    files = ['14307']
    hgrepos = []
    issue_num = 6291
    keywords = []
    message_count = 2.0
    messages = ['89428', '89431']
    nosy_count = 2.0
    nosy_names = ['r.david.murray', 'milivojm']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '5259'
    type = 'behavior'
    url = 'https://bugs.python.org/issue6291'
    versions = ['Python 3.0']

    Activity

    1. milivojm commented on Jun 16, 2009

      milivojmmannequin
      MannequinAuthor

      When trying to send an e-mail using a tutorial like example, I get the
      following message:

      Traceback (most recent call last):
        File "test.py", line 3, in <module>
          server.login("domena\someuser","somepassword")
        File "C:\Python\lib\smtplib.py", line 583, in login
          "%s %s" % (AUTH_LOGIN, encode_base64(user)))
        File "C:\Python\lib\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 Jun 16, 2009
    3. bitdancer commented on Jun 16, 2009

      @bitdancer
      Member

      This is a duplicate of bpo-5259, and has already been fixed. Thanks
      for the report.

    4. 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/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions