]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] 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:19:21 +0000 (16:19 +0200)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2026 14:19:21 +0000 (14:19 +0000)
commitc42d55c8b830ec915733a53b50549ab6430c478c
tree71f96fedcebe4b10cb57cf374b25e34723d18a26
parent64048038a645e4da9789d56959f6d4a7ed6a14c9
[3.15] gh-153417: Fix BytesWarning in imaplib error messages for bytes arguments (GH-153423) (GH-153430)

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]