From cb48867c0679d4722274db0cda2250a27417855d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 13 May 2026 16:55:45 +0200 Subject: [PATCH 1/2] gh-149776: Skip UDP Lite tests if it's not supported (#149777) Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if it's not supported. (cherry picked from commit 3cfc249e11a132dc69624150843779aa96c72b2b) --- Lib/test/test_socket.py | 21 ++++++++++++++++++- ...-05-13-14-53-23.gh-issue-149776.orqgsn.rst | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-05-13-14-53-23.gh-issue-149776.orqgsn.rst diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 15f7fb4a808ce76..e472e807a0ab3d5 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -142,6 +142,25 @@ def _have_socket_bluetooth(): return True +def _have_udp_lite(): + if not hasattr(socket, "IPPROTO_UDPLITE"): + return False + # Older Android versions block UDPLITE with SELinux. + if support.is_android and platform.android_ver().api_level < 29: + return False + + try: + sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) + except OSError as exc: + # Linux 7.1 removed UDP Lite support + if exc.errno == errno.EPROTONOSUPPORT: + return False + raise + sock.close() + + return True + + @contextlib.contextmanager def socket_setdefaulttimeout(timeout): old_timeout = socket.getdefaulttimeout() @@ -166,7 +185,7 @@ def socket_setdefaulttimeout(timeout): HAVE_SOCKET_VSOCK = _have_socket_vsock() -HAVE_SOCKET_UDPLITE = hasattr(socket, "IPPROTO_UDPLITE") +HAVE_SOCKET_UDPLITE = _have_udp_lite() HAVE_SOCKET_BLUETOOTH = _have_socket_bluetooth() diff --git a/Misc/NEWS.d/next/Tests/2026-05-13-14-53-23.gh-issue-149776.orqgsn.rst b/Misc/NEWS.d/next/Tests/2026-05-13-14-53-23.gh-issue-149776.orqgsn.rst new file mode 100644 index 000000000000000..e86a9130ff9bfb6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-05-13-14-53-23.gh-issue-149776.orqgsn.rst @@ -0,0 +1,2 @@ +Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if it's +not supported. Patch by Victor Stinner. From ad086ace1b2f0fb14732bcda0a9ab0ae02f8d41e Mon Sep 17 00:00:00 2001 From: Harjoth Khara Date: Fri, 10 Jul 2026 04:13:08 -0700 Subject: [PATCH 2/2] gh-153438: Update NuGet download URL (GH-153482) (cherry picked from commit 106eb532ea3b243423e62a702719e9d3c0e40c16) --- Doc/using/windows.rst | 3 ++- .../next/Build/2026-07-09-22-45-00.gh-issue-153438.Qr7N2p.rst | 2 ++ PCbuild/find_python.bat | 2 +- Tools/msi/get_externals.bat | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-07-09-22-45-00.gh-issue-153438.Qr7N2p.rst diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index 0c5684e570a10ad..47ce6c203ebe92a 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -397,7 +397,8 @@ on using nuget. What follows is a summary that is sufficient for Python developers. The ``nuget.exe`` command line tool may be downloaded directly from -``https://aka.ms/nugetclidl``, for example, using curl or PowerShell. With the +``https://dist.nuget.org/win-x86-commandline/latest/nuget.exe``, for example, +using curl or PowerShell. With the tool, the latest version of Python for 64-bit or 32-bit machines is installed using:: diff --git a/Misc/NEWS.d/next/Build/2026-07-09-22-45-00.gh-issue-153438.Qr7N2p.rst b/Misc/NEWS.d/next/Build/2026-07-09-22-45-00.gh-issue-153438.Qr7N2p.rst new file mode 100644 index 000000000000000..edab8e6ba7b2595 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-07-09-22-45-00.gh-issue-153438.Qr7N2p.rst @@ -0,0 +1,2 @@ +Update Windows build and installer tooling and documentation to use the +current download URL for ``nuget.exe``. diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat index d0e4a86b01fd03f..c59479876627dfd 100644 --- a/PCbuild/find_python.bat +++ b/PCbuild/find_python.bat @@ -45,7 +45,7 @@ @set _Py_HOST_PYTHON=%HOST_PYTHON% @if "%_Py_HOST_PYTHON%"=="" set _Py_HOST_PYTHON=py @if "%_Py_NUGET%"=="" (set _Py_NUGET=%_Py_EXTERNALS_DIR%\nuget.exe) -@if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://aka.ms/nugetclidl) +@if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) @if NOT exist "%_Py_NUGET%" ( @echo Downloading nuget... @rem NB: Must use single quotes around NUGET here, NOT double! diff --git a/Tools/msi/get_externals.bat b/Tools/msi/get_externals.bat index d66781d7c42ec49..e76ba701171c989 100644 --- a/Tools/msi/get_externals.bat +++ b/Tools/msi/get_externals.bat @@ -6,7 +6,7 @@ set HERE=%~dp0 if "%PCBUILD%"=="" (set PCBUILD=%HERE%..\..\PCbuild\) if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%HERE%..\..\externals\windows-installer) if "%NUGET%"=="" (set NUGET=%EXTERNALS_DIR%\..\nuget.exe) -if "%NUGET_URL%"=="" (set NUGET_URL=https://aka.ms/nugetclidl) +if "%NUGET_URL%"=="" (set NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) set DO_FETCH=true set DO_CLEAN=false