]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-79964: Clarify the imaplib fetch example in the docs (GH-152780) (GH-152859)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 2 Jul 2026 07:26:50 +0000 (09:26 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2026 07:26:50 +0000 (07:26 +0000)
A FETCH response may contain additional or unsolicited data, so the
message is not always data[0][1].
(cherry picked from commit 50ae0be74988564fb09746a49eb4b8f8e740f3c3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Doc/library/imaplib.rst

index b002f4978123e6d0b3509a94d0e6a6342cd2f062..cf475734636a20dad12d83eeaa470bc2c8e46848 100644 (file)
@@ -725,3 +725,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]``.
+