Skip to content

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

Open
harjothkhara wants to merge 1 commit into
python:mainfrom
harjothkhara:gh-151945-cookiejar-refs
Open

gh-151945: Fix reference warnings in http.cookiejar docs#152816
harjothkhara wants to merge 1 commit 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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33398384 | 📁 Comparing eecbef2 against main (df2538a)

  🔍 Preview build  

1 file changed
± library/http.cookiejar.html

@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 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 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 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.

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.

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

Labels

awaiting review 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