Skip to content

Commit 860e34e

Browse files
Fix allowlist entries in asyncio.windows_events (#10824)
And fix the return value of return value of `IocpProactor.recvfrom_into()`, which was incorrect Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent 54d825a commit 860e34e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

stdlib/asyncio/windows_events.pyi

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import socket
22
import sys
3-
from _typeshed import Incomplete, WriteableBuffer
3+
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
44
from collections.abc import Callable
55
from typing import IO, Any, ClassVar, NoReturn
66
from typing_extensions import Literal
@@ -48,6 +48,12 @@ if sys.platform == "win32":
4848
def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ...
4949
def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ...
5050
def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
51+
def recvfrom(
52+
self, conn: socket.socket, nbytes: int, flags: int = 0
53+
) -> futures.Future[tuple[bytes, socket._RetAddress]]: ...
54+
def sendto(
55+
self, conn: socket.socket, buf: ReadableBuffer, flags: int = 0, addr: socket._Address | None = None
56+
) -> futures.Future[int]: ...
5157
def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ...
5258
def accept(self, listener: socket.socket) -> futures.Future[Any]: ...
5359
def connect(
@@ -63,7 +69,7 @@ if sys.platform == "win32":
6369
if sys.version_info >= (3, 11):
6470
def recvfrom_into(
6571
self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0
66-
) -> tuple[int, socket._RetAddress]: ...
72+
) -> futures.Future[tuple[int, socket._RetAddress]]: ...
6773
SelectorEventLoop = _WindowsSelectorEventLoop
6874

6975
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):

tests/stubtest_allowlists/win32.txt

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ _winapi.CreateFileMapping
1010
_winapi.MapViewOfFile
1111
_winapi.OpenFileMapping
1212
_winapi.VirtualQuerySize
13-
asyncio.IocpProactor.recvfrom
14-
asyncio.IocpProactor.sendto
15-
asyncio.windows_events.IocpProactor.recvfrom
16-
asyncio.windows_events.IocpProactor.sendto
1713
msvcrt.SetErrorMode
1814
ssl.SSLSocket.recvmsg
1915
ssl.SSLSocket.recvmsg_into

0 commit comments

Comments
 (0)