Skip to content

[3.14] gh-153417: Fix BytesWarning in imaplib error messages for bytes arguments (GH-153423)#153431

Merged
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-11f1b70-3.14
Jul 9, 2026
Merged

[3.14] gh-153417: Fix BytesWarning in imaplib error messages for bytes arguments (GH-153423)#153431
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-11f1b70-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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 11f1b70)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

… arguments (pythonGH-153423)

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 11f1b70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@miss-islington miss-islington requested a review from a team as a code owner July 9, 2026 13:52
@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 9, 2026 14:06
@serhiy-storchaka serhiy-storchaka merged commit 8b6f732 into python:3.14 Jul 9, 2026
49 checks passed
@miss-islington miss-islington deleted the backport-11f1b70-3.14 branch July 9, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants