https://github.com/python/cpython/commit/d86c2257a69a8d6c650c0db470499463131a569f
commit: d86c2257a69a8d6c650c0db470499463131a569f
branch: main
author: Nick Burns <[email protected]>
committer: orsenthil <[email protected]>
date: 2025-08-15T13:47:46-07:00
summary:

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

* add versionchanged and example with quotes in cookie value

* update whatsnew with http.cookies change

* Update Doc/library/http.cookies.rst

Co-authored-by: Bénédikt Tran <[email protected]>

* Update Doc/whatsnew/3.15.rst

Co-authored-by: Bénédikt Tran <[email protected]>

* spelling, quote

* demonstrate json

* Update Doc/library/http.cookies.rst

Co-authored-by: Senthil Kumaran <[email protected]>

* Apply suggestions from code review

Co-authored-by: Adam Turner <[email protected]>

* shorter description

---------

Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Senthil Kumaran <[email protected]>
Co-authored-by: Adam Turner <[email protected]>

files:
M Doc/library/http.cookies.rst
M Doc/whatsnew/3.15.rst

diff --git a/Doc/library/http.cookies.rst b/Doc/library/http.cookies.rst
index 46efc45c5e7d96..9e7648ef6d8345 100644
--- a/Doc/library/http.cookies.rst
+++ b/Doc/library/http.cookies.rst
@@ -28,8 +28,10 @@ The character set, :data:`string.ascii_letters`, 
:data:`string.digits` and
 in a cookie name (as :attr:`~Morsel.key`).
 
 .. versionchanged:: 3.3
-   Allowed ':' as a valid cookie name character.
+   Allowed '``:``' as a valid cookie name character.
 
+.. versionchanged:: next
+   Allowed '``"``' as a valid cookie value character.
 
 .. note::
 
@@ -314,3 +316,10 @@ The following example demonstrates how to use the 
:mod:`http.cookies` module.
    >>> print(C)
    Set-Cookie: number=7
    Set-Cookie: string=seven
+   >>> import json
+   >>> C = cookies.SimpleCookie()
+   >>> C.load(f'cookies=7; mixins="{json.dumps({"chips": "dark chocolate"})}"; 
state=gooey')
+   >>> print(C)
+   Set-Cookie: cookies=7
+   Set-Cookie: mixins="{"chips": "dark chocolate"}"
+   Set-Cookie: state=gooey
diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst
index 6c5ab1bb1a1078..252d8966b7450f 100644
--- a/Doc/whatsnew/3.15.rst
+++ b/Doc/whatsnew/3.15.rst
@@ -267,6 +267,13 @@ http.client
   (Contributed by Alexander Enrique Urieles Nieto in :gh:`131724`.)
 
 
+http.cookies
+------------
+
+* Allow '``"``' double quotes in cookie values.
+  (Contributed by Nick Burns and Senthil Kumaran in :gh:`92936`.)
+
+
 math
 ----
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to