From c3c573a4e54c4c6c48dd50f3cb5164dd88aeec5d Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 4 Feb 2026 23:09:22 -0600 Subject: [PATCH 1/3] Update error message in _overlapped.BindLocal() Replace a confusing error message with one that actually explains what the error is in `_overlapped.BindLocal()`. Fixes: https://github.com/python/cpython/issues/144493 --- Modules/overlapped.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/overlapped.c b/Modules/overlapped.c index 09b57ce4b9773a..8c3575ff5678eb 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -559,7 +559,7 @@ _overlapped_BindLocal_impl(PyObject *module, HANDLE Socket, int Family) ret = bind((SOCKET)Socket, (SOCKADDR*)&addr, sizeof(addr)) != SOCKET_ERROR; } else { - PyErr_SetString(PyExc_ValueError, "expected tuple of length 2 or 4"); + PyErr_SetString(PyExc_ValueError, "Only AF_INET and AF_INET6 families are supported"); return NULL; } From d6bddec5ea2b5ac456a754b29e573bf9f92141de Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:15:32 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst diff --git a/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst b/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst new file mode 100644 index 00000000000000..084f88a45397d1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst @@ -0,0 +1 @@ +Improve an exception error message in ``_overlapped.BindLocal()`` that is raised when :meth:`asyncio.loop.sock_connect()` is called on a :class:`asyncio.ProactorEventLoop` with a socket that has an invalid address family. From 62790f7200f6e080f2838fcd5f2ce041af12e35c Mon Sep 17 00:00:00 2001 From: David Lechner Date: Thu, 5 Feb 2026 11:19:31 -0600 Subject: [PATCH 3/3] remove () to fix sphinx lint --- .../next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst b/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst index 084f88a45397d1..fe205b58013af0 100644 --- a/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst +++ b/Misc/NEWS.d/next/Library/2026-02-05-17-15-31.gh-issue-144493.XuxwVu.rst @@ -1 +1 @@ -Improve an exception error message in ``_overlapped.BindLocal()`` that is raised when :meth:`asyncio.loop.sock_connect()` is called on a :class:`asyncio.ProactorEventLoop` with a socket that has an invalid address family. +Improve an exception error message in ``_overlapped.BindLocal()`` that is raised when :meth:`asyncio.loop.sock_connect` is called on a :class:`asyncio.ProactorEventLoop` with a socket that has an invalid address family.