diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py index 2a7c18cda8a76a5..b17ac7ab255fc59 100644 --- a/Lib/asyncio/windows_events.py +++ b/Lib/asyncio/windows_events.py @@ -515,11 +515,11 @@ def recvfrom(self, conn, nbytes, flags=0): return self._register(ov, conn, partial(self._finish_recvfrom, empty_result=b'')) - def recvfrom_into(self, conn, buf, flags=0): + def recvfrom_into(self, conn, buf, nbytes=0): self._register_with_iocp(conn) ov = _overlapped.Overlapped(NULL) try: - ov.WSARecvFromInto(conn.fileno(), buf, flags) + ov.WSARecvFromInto(conn.fileno(), buf, nbytes) except BrokenPipeError: return self._result((0, None)) diff --git a/Misc/NEWS.d/next/Windows/2026-09-14-16-49-44.gh-issue-157418.r2IggA.rst b/Misc/NEWS.d/next/Windows/2026-09-14-16-49-44.gh-issue-157418.r2IggA.rst new file mode 100644 index 000000000000000..b1a048c46ab83cc --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-09-14-16-49-44.gh-issue-157418.r2IggA.rst @@ -0,0 +1,3 @@ +Correct the third parameter name of ``IocpProactor.recvfrom_into()`` from +*flags* to *nbytes* to reflect that it specifies the number of bytes to +receive.