From 6d3ffc2a40065787e06fefe64c02066678c4435b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 1 Jul 2026 15:31:00 +0300 Subject: [PATCH] gh-79964: Clarify the imaplib fetch example in the docs 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) --- Doc/library/imaplib.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index df2468f7124e6d..01de1bc393c5bb 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]``. +