gh-151945: Fix reference warnings in http.cookiejar docs#152816
gh-151945: Fix reference warnings in http.cookiejar docs#152816harjothkhara wants to merge 2 commits into
Conversation
Resolve the nit-picky reference warnings in Doc/library/http.cookiejar.rst and drop the file from Doc/tools/.nitignore so future regressions are caught by CI. Documented targets are qualified with their owning class, for example Cookie.version, CookiePolicy.rfc2965, the urllib.request.Request methods and attributes, and urllib.response.addinfourl.info. References with no documented target become inline literals: the removed get_origin_req_host method. The http.server part of the issue is left for a separate change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Documentation build overview
5 files changed ·
|
hugovk
left a comment
There was a problem hiding this comment.
Thanks! Whilst we're here, please could also update the headers to use sentence case?
https://devguide.python.org/documentation/style-guide/#capitalization
That is, change the four "Objects" to "objects":
| attribute. Dependency on a deprecated method ``get_origin_req_host`` has | ||
| been removed. |
There was a problem hiding this comment.
To keep same formatting:
| attribute. Dependency on a deprecated method ``get_origin_req_host`` has | |
| been removed. | |
| attribute. Dependency on a deprecated method | |
| :meth:`!get_origin_req_host` has been removed. |
| attribute. Dependency on a deprecated method ``get_origin_req_host`` has | ||
| been removed. |
There was a problem hiding this comment.
| attribute. Dependency on a deprecated method ``get_origin_req_host`` has | |
| been removed. | |
| attribute. Dependency on a deprecated method | |
| :meth:`!get_origin_req_host` has been removed. |
| turn it off again by | ||
| setting it to :const:`None`. |
There was a problem hiding this comment.
https://devguide.python.org/documentation/markup/#quick-reference
| turn it off again by | |
| setting it to :const:`None`. | |
| turn it off again by setting it to ``None``. |
And we can update the others in this file as well.
| Add correct :mailheader:`Cookie` header to *request*. | ||
|
|
||
| If policy allows (ie. the :attr:`rfc2965` and :attr:`hide_cookie2` attributes of | ||
| If policy allows (ie. the :attr:`~CookiePolicy.rfc2965` and |
There was a problem hiding this comment.
Let's also avoid Latin abbreviations, and you can update the other ie. and eg. in this file: https://devguide.python.org/documentation/style-guide/#use-simple-language
| If policy allows (ie. the :attr:`~CookiePolicy.rfc2965` and | |
| If policy allows (that is, the :attr:`~CookiePolicy.rfc2965` and |
StanFromIreland
left a comment
There was a problem hiding this comment.
The reference fixes here are correct 👍 Please apply Hugo's suggestions.
…ge, markup Apply Hugo's review feedback for Doc/library/http.cookiejar.rst: - Use sentence case for the four "... Objects" section headers. - Replace the Latin abbreviations "ie."/"eg." with "that is"/"for example" per the devguide simple-language guidance. - Use ``None`` literal markup instead of :const:`None`. - Reference the removed method as :meth:`!get_origin_req_host` to match the surrounding formatting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3945666 to
097e9ce
Compare
|
Thank you both! Applied all of Hugo's suggestions. Please re-review when you get a chance. |
StanFromIreland
left a comment
There was a problem hiding this comment.
Spotted two little things.
| *filename* is the name of file in which to save cookies. If *filename* is not | ||
| specified, :attr:`self.filename` is used (whose default is the value passed to | ||
| the constructor, if any); if :attr:`self.filename` is :const:`None`, | ||
| specified, :attr:`~FileCookieJar.filename` is used (whose default is the |
There was a problem hiding this comment.
Let's keep it as self.filename here, otherwise it renders confusingly as "filename."
| :meth:`urllib.request.urlopen`, or similar) should support an :meth:`info` | ||
| method, which returns an :class:`email.message.Message` instance. | ||
| :meth:`urllib.request.urlopen`, or similar) should support an | ||
| :meth:`~urllib.response.addinfourl.info` method, which returns an |
There was a problem hiding this comment.
This method is deprecated, this should link to http.client.HTTPResponse.
Per @picnixz's suggestion in gh-151945, this covers the
http.cookiejarhalf of the issue; @picnixz is taking
http.server.Fixes the Sphinx nit-picky reference warnings for
Doc/library/http.cookiejar.rstand removes the file fromDoc/tools/.nitignoreso future regressions are caught by CI.Cookie.version,CookiePolicy.rfc2965/hide_cookie2, theurllib.request.Requestmethods and attributes, andurllib.response.addinfourl.info.get_origin_req_hostmethod, which has no documentedtarget, becomes an inline literal.
Verified with a full nit-picky build: the file emits no warnings and
Doc/tools/check-warnings.py --fail-if-regression --fail-if-improvedpasses. Documentation-only reference fix, so no NEWS entry (skip news).
Disclosure: I used AI assistance on this change; I've reviewed it and can
explain it.
Doc/library/http.{cookiejar,server}.rst#151945