Skip to content

gh-92936: update http.cookies docs post GH-113663 #137566

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 15, 2025

Conversation

nburns
Copy link
Contributor

@nburns nburns commented Aug 8, 2025

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

Also add a What's New entry (Doc/whatsnew/3.15.rst).

@picnixz picnixz changed the title gh-92936: update http.cookie docs gh-92936: update http.cookies docs post GH-113663 Aug 8, 2025
@nburns nburns requested a review from AA-Turner as a code owner August 8, 2025 20:35
@nburns nburns force-pushed the update-http-cookie-docs-example branch from 1416a5f to 8598956 Compare August 8, 2025 20:37
@nburns nburns force-pushed the update-http-cookie-docs-example branch from 8598956 to 75803bc Compare August 8, 2025 20:57
@picnixz
Copy link
Member

picnixz commented Aug 8, 2025

Please avoid force-pushing. It makes incremental review harder. We squash-merge commits at the end.

@nburns
Copy link
Contributor Author

nburns commented Aug 8, 2025

I sure will, thanks for all your help!

@nburns nburns requested a review from orsenthil August 12, 2025 21:02
Copy link
Member

@orsenthil orsenthil left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 269 to 270
* Allow ``"`` double quotes in cookie values with a more linient regex for
double-quoted strings.
Copy link
Member

Choose a reason for hiding this comment

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

Can we be more specific about what's changed than "a more lenient regex"? For example, do we now properly conform to an RFC/web specification? Are there restrictions that still exist on double-quoted strings?

Suggested change
* Allow ``"`` double quotes in cookie values with a more linient regex for
double-quoted strings.
* Allow '``"``' double quotes in cookie values with a more lenient regex for
double-quoted strings.

Comment on lines 269 to 270
* Allow '``"``' double quotes in cookie values with a more lenient regex for
double-quoted strings.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
* Allow '``"``' double quotes in cookie values with a more lenient regex for
double-quoted strings.
* Allow '``"``' double quotes in cookie values with a more lenient regex for
double-quoted strings by not explicitly excluding a quote inside the value part of a cookie.

It's pretty similar to what was there before, just doesn't exclude the quotes: https://github.com/python/cpython/pull/113663/files#diff-e49aab1421911b035542d1a9221c31b8c74053f0e8b28f90f03af66177026176R429

Copy link
Member

Choose a reason for hiding this comment

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

This is becoming little too detailed for a whatsnew item. Since it is both a bugfix and behavior change (ref #137566 (comment))

We could say - "Allow '"' double quotes in cookie values" or the existing detail is fine with me.

@AA-Turner, what is your suggestion here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally I'm a fan of the shorter

"Allow '"' double quotes in cookie values"

Copy link
Member

Choose a reason for hiding this comment

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

I am good with the shorter version too. It is clear without confusing on the internal details like lenient regex (which the reader of whatsnew doc doesn't need to bother about) and if they really want they could refer to git log, bug report and other discussions.

@orsenthil
Copy link
Member

LGTM.

@orsenthil orsenthil merged commit d86c225 into python:main Aug 15, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Aug 15, 2025
@nburns
Copy link
Contributor Author

nburns commented Aug 15, 2025

@orsenthil and everyone else, just wanted to say thanks for working with me on my first contribution to Python ❤️

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.

4 participants