From cfd6da849a3c40904cddd23ae1700605877673fb Mon Sep 17 00:00:00 2001 From: Abdul Date: Sun, 27 Jul 2025 08:47:21 +0100 Subject: [PATCH 1/2] gh-137058: Update C23 standard version check in `pyport.h` (#137127) Use `__STDC_VERSION__ >= 202311L` instead of `__STDC_VERSION__ > 201710L`. --- Include/pyport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/pyport.h b/Include/pyport.h index 89829373be2ca2..62db8d07701d1d 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -50,7 +50,7 @@ // to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer, // _Py_NULL is defined as nullptr. #if !defined(_MSC_VER) && \ - ((defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) \ + ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) \ || (defined(__cplusplus) && __cplusplus >= 201103)) # define _Py_NULL nullptr #else From ae8b7d710020dfd336edd399fa35525dfe8fc049 Mon Sep 17 00:00:00 2001 From: Iqra Khan Date: Sun, 27 Jul 2025 13:57:08 +0530 Subject: [PATCH 2/2] gh-136992: Add "None" as valid `SameSite` value as per RFC 6265bis (#137040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "SameSite" attribute defined in RFC 6265bis [1] allows the "Strict", "Lax" and "None" enforcement modes. We already documented "Strict" and "Lax" as being valid values but "None" was missing from the list. While the RFC has not been formally approved, modern browsers support the "None" value [2, 3] thereby making sense to document it. [1]: https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis [2]: https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure [3]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#none --------- Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/http.cookies.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Doc/library/http.cookies.rst b/Doc/library/http.cookies.rst index eb196320721194..46efc45c5e7d96 100644 --- a/Doc/library/http.cookies.rst +++ b/Doc/library/http.cookies.rst @@ -148,9 +148,12 @@ Morsel Objects in HTTP requests, and is not accessible through JavaScript. This is intended to mitigate some forms of cross-site scripting. - The attribute :attr:`samesite` specifies that the browser is not allowed to - send the cookie along with cross-site requests. This helps to mitigate CSRF - attacks. Valid values for this attribute are "Strict" and "Lax". + The attribute :attr:`samesite` controls when the browser sends the cookie with + cross-site requests. This helps to mitigate CSRF attacks. Valid values are + "Strict" (only sent with same-site requests), "Lax" (sent with same-site + requests and top-level navigations), and "None" (sent with same-site and + cross-site requests). When using "None", the "secure" attribute must also + be set, as required by modern browsers. The attribute :attr:`partitioned` indicates to user agents that these cross-site cookies *should* only be available in the same top-level context