Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-101100: Fix sphinx warnings inlibrary/email.parser.rst
#136475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
515b3d1
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks. |
Thanks@LamentXU123 for the PR, and@hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…ythonGH-136475)(cherry picked from commit515b3d1)Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
…ythonGH-136475)(cherry picked from commit515b3d1)Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
GH-136532 is a backport of this pull request to the3.14 branch. |
GH-136533 is a backport of this pull request to the3.13 branch. |
@@ -155,11 +155,11 @@ message body, instead setting the payload to the raw body. | |||
Read all the data from the binary file-like object *fp*, parse the | |||
resulting bytes, and return the message object. *fp* must support | |||
both the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read` | |||
both the :meth:`~io.IOBase.readline` and the :meth:`~io.TextIOBase.read` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a binary file-like object.io.TextIOBase.read
is incorrect reference.
LamentXU123Jul 11, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes I'm not quite sure about this change. There is indeed no doc to~io.IOBase.read
, I suggest to add one here maybe in the future issues(?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Now, lets subpress this link. It is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It is better to add the documentation or the anchor forio.IOBase.read
, but this is a separate issue. We will need to find also all silenced references to it.
For now, just restore the old code. Without silencing unresolved references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
IOBase
doesn't declareread
on purpose because:
Even though IOBase does not declare read, readinto, or write because
their signatures will vary, implementations and clients should
consider those methods part of the interface.
Currently, inio.rst
, we also suppress theread
method for IOBase. So, we should considerread
as a "protocol" that follows "some" signature whose defaults have "some" meanings (again it depends on the object itself).
I suggest that we revert this entirely and keep the warning to know in the future which read() protocol it should follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please see PR#136629 to revert.
@@ -48,8 +48,8 @@ methods. | |||
FeedParser API | |||
^^^^^^^^^^^^^^ | |||
The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module, | |||
provides an API that is conducive to incremental parsing of email messages, | |||
The :class:`BytesFeedParser`, imported from the :mod:`email.parser.FeedParser` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The name of the module isemail.feedparser
.email.parser.FeedParser
is not a module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oups, sry for this overlook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Same for this. It seems like we don't get a doc foremail.feedparser
. We can add it later. Now I suggest to subpress the link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I suggest we don't suppress links but keep the warnings so to know which objects need to be documented. Suppressing the links is not a good idea here.
LamentXU123 commentedJul 11, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi@hugovk, the two changes are indeed incorrect. Please revert it. Sry for the overlook. Just subpress the two links mentioned before is OK. sry again. |
….rst` (python#136475)"This reverts commit515b3d1.
…ail.parser.rst` (pythonGH-136475)" (pythonGH-136629)(cherry picked from commit5bbf30e)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
…ail.parser.rst` (pythonGH-136475)" (pythonGH-136629)(cherry picked from commit5bbf30e)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
before:
This PR fix them all. The changes:
email.feedparser
is actually referring toemail.parser.FeedParser. It is changed toemail.parser.FeedParser
. See alsoother places of referrence toemail.parser.feedparser
to check.email.policy.Policy.utf8
is actually referring toemail.policy.EmailPolicy.utf8. It is changed toemail.policy.EmailPolicy.utf8
io.IOBase.read
is actually referring toio.TextIOBase.read. See alsoother places of referrence toio.TextIOBase.read
to check. I'm not pretty sure about this.📚 Documentation preview 📚:https://cpython-previews--136475.org.readthedocs.build/