Skip to content

Commit 58d92ac

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.15] gh-79964: Clarify the imaplib fetch example in the docs (GH-152780) (GH-152859)
A FETCH response may contain additional or unsolicited data, so the message is not always data[0][1]. (cherry picked from commit 50ae0be) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7d8b0b3 commit 58d92ac

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/imaplib.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,3 +725,10 @@ retrieves and prints all messages::
725725
M.close()
726726
M.logout()
727727

728+
.. note::
729+
730+
A ``FETCH`` response may contain additional or unsolicited data
731+
(see :rfc:`3501`, section 7.4.2),
732+
so production code should inspect the whole response
733+
rather than rely on ``data[0][1]``.
734+

0 commit comments

Comments
 (0)