Skip to content

Commit efa7a51

Browse files
authored
Add a few missing things on Windows, py310+ (#10817)
1 parent 3eb9ff7 commit efa7a51

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

stdlib/_winapi.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,4 @@ if sys.platform == "win32":
255255

256256
if sys.version_info >= (3, 12):
257257
def CopyFile2(existing_file_name: str, new_file_name: str, flags: int, progress_routine: int | None = None) -> int: ...
258+
def NeedCurrentDirectoryForExePath(__exe_name: str) -> bool: ...

stdlib/asyncio/windows_events.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ if sys.platform == "win32":
6060
async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ...
6161
def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ...
6262
def close(self) -> None: ...
63+
if sys.version_info >= (3, 11):
64+
def recvfrom_into(
65+
self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0
66+
) -> tuple[int, socket._RetAddress]: ...
6367
SelectorEventLoop = _WindowsSelectorEventLoop
6468

6569
class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):

stdlib/msvcrt.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ if sys.platform == "win32":
2626
def ungetch(__char: bytes | bytearray) -> None: ...
2727
def ungetwch(__unicode_char: str) -> None: ...
2828
def heapmin() -> None: ...
29+
if sys.version_info >= (3, 10):
30+
def GetErrorMode() -> int: ... # undocumented

tests/stubtest_allowlists/win32-py310.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Exists at runtime, but missing from stubs
2-
msvcrt.GetErrorMode
3-
41
# pathlib methods that exist on Windows, but always raise NotImplementedError,
52
# so are omitted from the stub
63
pathlib.Path.is_mount

tests/stubtest_allowlists/win32-py311.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Exists at runtime, missing from the stubs
2-
asyncio.IocpProactor.recvfrom_into
3-
asyncio.windows_events.IocpProactor.recvfrom_into
4-
msvcrt.GetErrorMode
5-
61
# pathlib methods that exist on Windows, but always raise NotImplementedError,
72
# so are omitted from the stub
83
pathlib.Path.is_mount
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
_winapi.NeedCurrentDirectoryForExePath
2-
asyncio.IocpProactor.finish_socket_func
3-
asyncio.IocpProactor.recvfrom_into
4-
asyncio.windows_events.IocpProactor.finish_socket_func
5-
asyncio.windows_events.IocpProactor.recvfrom_into
6-
msvcrt.GetErrorMode
1+
# CPython bug; waiting on https://github.com/python/cpython/pull/109790 to be backported
72
ntpath.isdir
83
os.path.isdir
4+
5+
# Undocumented internal method, not really for public consumption.
6+
# (Hard to add types for unless we add stubs for the undocumented _overlapped module...)
7+
asyncio.IocpProactor.finish_socket_func
8+
asyncio.windows_events.IocpProactor.finish_socket_func

0 commit comments

Comments
 (0)