Commit 2644102
committed
bpo-46943: fix[imaplib]: call Exception with string instance
Adjust the behavior 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 instance1 parent 0b20bff commit 2644102
2 files changed
+11
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | | - | |
| 706 | + | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
437 | 447 | | |
438 | 448 | | |
439 | 449 | | |
| |||
0 commit comments