]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-153417: Fix BytesWarning in imaplib error messages for bytes arguments...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Jul 2026 14:17:41 +0000 (16:17 +0200)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2026 14:17:41 +0000 (14:17 +0000)
commit31fac5d8f7f1fc58c0b831c627a534a96d0af25a
tree6f6f2498b36dc3c663509519e22cb104d1d061f7
parent91abe31b2cf8ce2dd3547eb6495de884ff4329ef
[3.13] gh-153417: Fix BytesWarning in imaplib error messages for bytes arguments (GH-153423) (GH-153432)

IMAP4.select() and IMAP4.uid() formatted the mailbox and command argument
with %s in their error messages, which raised BytesWarning under -bb when the
argument was bytes and masked the real error.  Use %r instead, which is safe
for bytes and also quotes the value.
(cherry picked from commit 11f1b70f4c981b781aaa94427dc1fceb637b2187)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/NEWS.d/next/Library/2026-07-09-14-00-00.gh-issue-153417.Bw7Rq2.rst [new file with mode: 0644]