Skip to content

Commit 551703e

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.14] gh-79964: Clarify the imaplib fetch example in the docs (GH-152780) (GH-152860)
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 17b0869 commit 551703e

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
@@ -723,3 +723,10 @@ retrieves and prints all messages::
723723
M.close()
724724
M.logout()
725725

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

0 commit comments

Comments
 (0)