New submission from SpaceOne <[email protected]>:
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
----------
components: Library (Lib)
messages: 414657
nosy: spaceone
priority: normal
severity: normal
status: open
title: fix[imaplib]: call Exception with string instance
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46943>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com