From cac197aa9cff0e86fdeecd4407cf8b0129ba9849 Mon Sep 17 00:00:00 2001 From: gwjacobs <146255974+gwjacobs@users.noreply.github.com> Date: Thu, 10 Sep 2026 15:34:32 -0400 Subject: [PATCH 1/5] Fix a broken reference link in the `colorsys` docs (#152028) --- Doc/library/colorsys.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/colorsys.rst b/Doc/library/colorsys.rst index dffc16ae8b7d475..35873c9de619de2 100644 --- a/Doc/library/colorsys.rst +++ b/Doc/library/colorsys.rst @@ -19,7 +19,7 @@ spaces, the coordinates are all between 0 and 1. .. seealso:: More information about color spaces can be found at - https://poynton.ca/ColorFAQ.html and + https://www.poynton.ca/pdf/ColourFAQ.pdf and https://www.cambridgeincolour.com/tutorials/color-spaces.htm. The :mod:`!colorsys` module defines the following functions: From f64ebfbc2bf7de7905d5b7fdafb9ba1ab1c251bb Mon Sep 17 00:00:00 2001 From: Yashraj Date: Fri, 11 Sep 2026 02:10:04 +0530 Subject: [PATCH 2/5] gh-142197: Doc: Add missing import statement in importlib.metadata overview (#142208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Edgar Ramírez Mondragón Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Doc/library/importlib.metadata.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst index e11db37b9fad501..1378a131f0ce651 100644 --- a/Doc/library/importlib.metadata.rst +++ b/Doc/library/importlib.metadata.rst @@ -90,6 +90,7 @@ collection of :ref:`EntryPoint ` objects. You can get the :ref:`metadata for a distribution `:: + >>> from importlib.metadata import metadata # doctest: +SKIP >>> list(metadata('wheel')) # doctest: +SKIP ['Metadata-Version', 'Name', 'Version', 'Summary', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Project-URL', 'Project-URL', 'Project-URL', 'Keywords', 'Platform', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Requires-Python', 'Provides-Extra', 'Requires-Dist', 'Requires-Dist'] From 4849a01020903a3d727c65130b9193198176c9af Mon Sep 17 00:00:00 2001 From: "Jonathan J. Helmus" Date: Thu, 10 Sep 2026 15:58:27 -0500 Subject: [PATCH 3/5] gh-153400: Support os.getrandom() on old glibc versions (#155762) Use the libc-provided SYS_getrandom syscall number when available, falling back to the kernel-provided __NR_getrandom when necessary. --- .../Build/2026-08-14-20-16-55.gh-issue-153400.9Oxi-N.rst | 1 + Modules/posixmodule.c | 3 +++ Python/bootstrap_hash.c | 5 ++++- configure | 6 +++++- configure.ac | 6 +++++- 5 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-08-14-20-16-55.gh-issue-153400.9Oxi-N.rst diff --git a/Misc/NEWS.d/next/Build/2026-08-14-20-16-55.gh-issue-153400.9Oxi-N.rst b/Misc/NEWS.d/next/Build/2026-08-14-20-16-55.gh-issue-153400.9Oxi-N.rst new file mode 100644 index 000000000000000..17241c897905b0e --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-08-14-20-16-55.gh-issue-153400.9Oxi-N.rst @@ -0,0 +1 @@ +Support os.getrandom() when building Python with old glibc versions and recent Linux kernel (glibc 2.25 or older and Linux kernel 3.17 or newer). Get the syscall number from kernel headers, rather than glibc headers. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7636d51485c730d..ead2371e3414414 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -161,6 +161,9 @@ #ifdef HAVE_SYS_SYSCALL_H # include // syscall(), __NR_xxx syscall numbers #endif +#if !defined(SYS_getrandom) && defined(__NR_getrandom) +# define SYS_getrandom __NR_getrandom +#endif #ifdef HAVE_POSIX_SPAWN # include // posix_spawn() diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index 5bc45d503360376..a22688827612657 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -23,7 +23,10 @@ # include // getrandom() # endif # if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL) -# include // SYS_getrandom +# include // __NR_getrandom, SYS_getrandom +# if !defined(SYS_getrandom) && defined(__NR_getrandom) +# define SYS_getrandom __NR_getrandom +# endif # endif #endif diff --git a/configure b/configure index ae3f0450dc7af1b..7d6c321ae38130b 100755 --- a/configure +++ b/configure @@ -34338,7 +34338,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #include #include #include - #include + #include // GRND_NONBLOCK + + #if !defined(SYS_getrandom) && defined(__NR_getrandom) + # define SYS_getrandom __NR_getrandom + #endif int main(void) { char buffer[1]; diff --git a/configure.ac b/configure.ac index 1c42900cb975c35..0cf27376015aef9 100644 --- a/configure.ac +++ b/configure.ac @@ -7895,7 +7895,11 @@ AC_LINK_IFELSE( #include #include #include - #include + #include // GRND_NONBLOCK + + #if !defined(SYS_getrandom) && defined(__NR_getrandom) + # define SYS_getrandom __NR_getrandom + #endif int main(void) { char buffer[1]; From bba99f2b3272cbe47af9bee05a294961c0528829 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 10 Sep 2026 23:10:46 +0200 Subject: [PATCH 4/5] gh-121647: Fix _Py_TYPEOF() on C++ (#157267) Using MSVC (on Windows), _Py_TYPEOF() prefers decltype() over __typeof__() on C++. Fix also _Py_TYPEOF() usage in Py_CLEAR() and Py_SETREF() macros. Replace "_Py_TYPEOF(dst)*" with "_Py_TYPEOF(&(dst))". In C++, "_Py_TYPEOF(dst)*" can fail with a compiler error. --- Include/cpython/object.h | 4 ++-- Include/pyport.h | 11 +++++++---- Include/refcount.h | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Include/cpython/object.h b/Include/cpython/object.h index 4c5a677e5543ece..0ef52d4d2bc7b4b 100644 --- a/Include/cpython/object.h +++ b/Include/cpython/object.h @@ -352,7 +352,7 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *); #ifdef _Py_TYPEOF #define Py_SETREF(dst, src) \ do { \ - _Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \ + _Py_TYPEOF(&(dst)) _tmp_dst_ptr = &(dst); \ _Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \ *_tmp_dst_ptr = (src); \ Py_DECREF(_tmp_old_dst); \ @@ -374,7 +374,7 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *); #ifdef _Py_TYPEOF #define Py_XSETREF(dst, src) \ do { \ - _Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \ + _Py_TYPEOF(&(dst)) _tmp_dst_ptr = &(dst); \ _Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \ *_tmp_dst_ptr = (src); \ Py_XDECREF(_tmp_old_dst); \ diff --git a/Include/pyport.h b/Include/pyport.h index 03f9b869bc82b55..744bae6c57e299e 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -538,15 +538,18 @@ extern "C" { // // Example: _Py_TYPEOF(x) x_copy = (x); // -// On C23, use typeof(). Otherwise __typeof__() if on GCC, clang or -// MSVC 17.9 and newer. Else if on C++11 or newer, decltype() is used. +// On C23, use typeof(). On C++11, use decltype(). Otherwise, use __typeof__() +// if on GCC, clang or MSVC 17.9 and newer. +// +// On MSVC, check also _MSVC_LANG since __cplusplus is 199711L unless +// the /Zc:__cplusplus flag is used. #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 202311L # define _Py_TYPEOF(expr) typeof(expr) +#elif defined(__cplusplus) && (__cplusplus >= 201103L || _MSVC_LANG >= 201103L) +# define _Py_TYPEOF(expr) decltype(expr) #elif defined(__GNUC__) || defined(__clang__) || \ (defined(_MSC_VER) && _MSC_VER >= 1939) # define _Py_TYPEOF(expr) __typeof__(expr) -#elif defined(__cplusplus) && __cplusplus >= 201103L -# define _Py_TYPEOF(expr) decltype(expr) #endif diff --git a/Include/refcount.h b/Include/refcount.h index b21697ae1780fa8..d96c75421aef337 100644 --- a/Include/refcount.h +++ b/Include/refcount.h @@ -482,7 +482,7 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op) #ifdef _Py_TYPEOF #define Py_CLEAR(op) \ do { \ - _Py_TYPEOF(op)* _tmp_op_ptr = &(op); \ + _Py_TYPEOF(&(op)) _tmp_op_ptr = &(op); \ _Py_TYPEOF(op) _tmp_old_op = (*_tmp_op_ptr); \ if (_tmp_old_op != _Py_NULL) { \ *_tmp_op_ptr = _Py_NULL; \ From 8f847875d60c81841e18a20510257a6e1b45b146 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 10 Sep 2026 22:21:15 +0100 Subject: [PATCH 5/5] Add documentation on PyManager proxy setting overrides (GH-156768) --- Doc/using/windows.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index 3a32c193e3a8fc8..5dfc16fe68b26d5 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -943,6 +943,37 @@ checking for that feed. } +Proxy Settings +-------------- + +.. versionadded:: 26.4 + +By default, the Python install manager will use your system-wide proxy settings, +including automatic authentication. For most users, this behaves the same as +your browser and other applications. + +To override the settings, use the ``NO_PROXY``, ``HTTP_PROXY`` and +``HTTPS_PROXY`` environment variables. These should be set in the terminal +session before using the Python install manager. Other applications may also +use the variables, so use caution before setting them globally for your entire +machine. + +Setting ``NO_PROXY`` to any non-empty value will disable the use of any proxy. +Use this to bypass your system's default proxy setting and attempt to access the +index server directly. + +Setting ``HTTPS_PROXY`` to a string like ``example.com:8080`` will connect to +that proxy server for all HTTPS connections. For the default index, all +connections will be using HTTPS, and so this is the usual setting to override. + +The ``HTTP_PROXY`` variable may be needed if you are using a private index +server that does not use encrypted connections, but does require the default +proxy server to be overridden. It follows the same format as ``HTTPS_PROXY``. + +Credentials may be embedded in either setting, however, when ``HTTPS_PROXY`` has +credentials embedded they will be used in preference to other credentials. Only +one set of credentials will be used for both types of proxy. + .. _pymanager-troubleshoot: Troubleshooting