This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spaceone
Recipients spaceone
Date 2022-03-07.11:30:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org>
In-reply-to
Content
imaplib raises an Exception with a bytes instance once (in login()) - all other places str instances are raised.

Adjust the behavior of login() similar to authenticate() where self.error is called with a str instance.

Especially for Python3 with strict bytes mode (-bb) this is helpful and prevents:

    Traceback (most recent call last):
      in "<stdin>"
        self.login(email, password)
      File "/usr/lib/python3.7/imaplib.py", line 598, in login
        raise self.error(dat[-1])
    imaplib.error: <exception str() failed>
    
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      in "<stdin>"
        str(exc)
    BytesWarning: str() on a bytes instance
History
Date User Action Args
2022-03-07 11:30:04spaceonesetrecipients: + spaceone
2022-03-07 11:30:04spaceonesetmessageid: <1646652604.57.0.383929268002.issue46943@roundup.psfhosted.org>
2022-03-07 11:30:04spaceonelinkissue46943 messages
2022-03-07 11:30:04spaceonecreate