From: Serhiy Storchaka Date: Thu, 2 Jul 2026 07:18:51 +0000 (+0300) Subject: gh-79964: Clarify the imaplib fetch example in the docs (GH-152780) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=50ae0be74988564fb09746a49eb4b8f8e740f3c3;p=thirdparty%2FPython%2Fcpython.git gh-79964: Clarify the imaplib fetch example in the docs (GH-152780) A FETCH response may contain additional or unsolicited data, so the message is not always data[0][1]. Co-authored-by: Claude Opus 4.8 (1M context) --- diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index df2468f7124e..01de1bc393c5 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -730,3 +730,10 @@ retrieves and prints all messages:: M.close() M.logout() +.. note:: + + A ``FETCH`` response may contain additional or unsolicited data + (see :rfc:`3501`, section 7.4.2), + so production code should inspect the whole response + rather than rely on ``data[0][1]``. +