Skip to content

gh-151945: Fix reference warnings in http.cookiejar docs#152816

Open
harjothkhara wants to merge 2 commits into
python:mainfrom
harjothkhara:gh-151945-cookiejar-refs
Open

gh-151945: Fix reference warnings in http.cookiejar docs#152816
harjothkhara wants to merge 2 commits into
python:mainfrom
harjothkhara:gh-151945-cookiejar-refs

Conversation

@harjothkhara

Copy link
Copy Markdown
Contributor

Per @picnixz's suggestion in gh-151945, this covers the http.cookiejar
half of the issue; @picnixz is taking http.server.

Fixes the Sphinx nit-picky reference warnings for
Doc/library/http.cookiejar.rst and removes the file from
Doc/tools/.nitignore so future regressions are caught by CI.

  • Documented targets are qualified with their owning class, e.g.
    Cookie.version, CookiePolicy.rfc2965/hide_cookie2, the
    urllib.request.Request methods and attributes, and
    urllib.response.addinfourl.info.
  • The removed get_origin_req_host method, which has no documented
    target, 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-improved
passes. 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.

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>
@read-the-docs-community

read-the-docs-community Bot commented Jul 1, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33413357 | 📁 Comparing 097e9ce against main (df2538a)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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":

Image

Comment thread Doc/library/http.cookiejar.rst Outdated
Comment on lines +176 to +177
attribute. Dependency on a deprecated method ``get_origin_req_host`` has
been removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep same formatting:

Suggested change
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.

Comment thread Doc/library/http.cookiejar.rst Outdated
Comment on lines +206 to +207
attribute. Dependency on a deprecated method ``get_origin_req_host`` has
been removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment thread Doc/library/http.cookiejar.rst Outdated
Comment on lines 481 to 482
turn it off again by
setting it to :const:`None`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://devguide.python.org/documentation/markup/#quick-reference

Suggested change
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.

Comment thread Doc/library/http.cookiejar.rst Outdated
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
If policy allows (ie. the :attr:`~CookiePolicy.rfc2965` and
If policy allows (that is, the :attr:`~CookiePolicy.rfc2965` and

@hugovk hugovk 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 2, 2026

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@harjothkhara harjothkhara force-pushed the gh-151945-cookiejar-refs branch from 3945666 to 097e9ce Compare July 2, 2026 14:59
@harjothkhara

Copy link
Copy Markdown
Contributor Author

Thank you both! Applied all of Hugo's suggestions. Please re-review when you get a chance.

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is deprecated, this should link to http.client.HTTPResponse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge docs Documentation in the Doc dir 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 skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants