]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-153494: Encode imaplib search criteria to the declared CHARSET (GH-153495)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 10 Jul 2026 15:42:07 +0000 (18:42 +0300)
committerGitHub <noreply@github.com>
Fri, 10 Jul 2026 15:42:07 +0000 (18:42 +0300)
commit5aafbea2c9890ad8d179432a0ea2e06c6ca9cec3
treee312a011fdc53451e01ca35e498bfd971802a18e
parent8a32914f78e0a1b1238548c3d575aa8ce3854d8c
gh-153494: Encode imaplib search criteria to the declared CHARSET (GH-153495)

IMAP4.search(), sort(), thread() and the uid SORT/THREAD variants now encode
str search criteria to the declared charset, so international search text can
be passed as ordinary str.  A criterion passed as bytes is sent unchanged, for
use with a charset that Python has no codec for.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/imaplib.rst
Doc/whatsnew/3.16.rst
Lib/imaplib.py
Lib/test/test_imaplib.py
Misc/NEWS.d/next/Library/2026-07-10-16-00-00.gh-issue-153494.qCh8rT.rst [new file with mode: 0644]