Skip to content

Commit fba6c1a

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.13] gh-79964: Clarify the imaplib fetch example in the docs (GH-152780) (GH-152861)
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 69fcc3f commit fba6c1a

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
@@ -649,3 +649,10 @@ retrieves and prints all messages::
649649
M.close()
650650
M.logout()
651651

652+
.. note::
653+
654+
A ``FETCH`` response may contain additional or unsolicited data
655+
(see :rfc:`3501`, section 7.4.2),
656+
so production code should inspect the whole response
657+
rather than rely on ``data[0][1]``.
658+

0 commit comments

Comments
 (0)