[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>