Skip to content

gh-79964: Clarify the imaplib fetch example in the docs#152780

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:imaplib-fetch-example-doc
Jul 2, 2026
Merged

gh-79964: Clarify the imaplib fetch example in the docs#152780
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:imaplib-fetch-example-doc

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 1, 2026

Copy link
Copy Markdown
Member

The "IMAP4 Example" prints the message body as data[0][1], which is a
widely-copied pattern. But a FETCH response may include additional or
unsolicited data (:rfc:3501, section 7.4.2), so data[0][1] is not
reliably the requested content.

This adds a note after the example clarifying that production code should
inspect the whole response. The example itself is left minimal.

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) <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka requested a review from a team as a code owner July 1, 2026 12:44
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Jul 1, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jul 1, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 1, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33393186 | 📁 Comparing 6d3ffc2 against main (b52bc56)

  🔍 Preview build  

1 file changed
± library/imaplib.html

@serhiy-storchaka serhiy-storchaka merged commit 50ae0be into python:main Jul 2, 2026
42 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 2, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 2, 2026

Copy link
Copy Markdown

GH-152859 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 2, 2026
@bedevere-app

bedevere-app Bot commented Jul 2, 2026

Copy link
Copy Markdown

GH-152860 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 2, 2026
@bedevere-app

bedevere-app Bot commented Jul 2, 2026

Copy link
Copy Markdown

GH-152861 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 2, 2026
@serhiy-storchaka serhiy-storchaka deleted the imaplib-fetch-example-doc branch July 2, 2026 07:19
serhiy-storchaka added a commit that referenced this pull request Jul 2, 2026
…2780) (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>
serhiy-storchaka added a commit that referenced this pull request Jul 2, 2026
…2780) (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>
serhiy-storchaka added a commit that referenced this pull request Jul 2, 2026
…2780) (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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant