From d6403b14aa300f40abfe91dc8d092734b56fa570 Mon Sep 17 00:00:00 2001 From: Jakob Stadler <127443735+Jakob-Stadler@users.noreply.github.com> Date: Thu, 9 Nov 2023 00:44:14 +0100 Subject: [PATCH] stdlib: Fix os.startfile (#10996) Fixes #10991 --- stdlib/os/__init__.pyi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 7fd04218f..2f47c4a82 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -923,10 +923,16 @@ def times() -> times_result: ... def waitpid(__pid: int, __options: int) -> tuple[int, int]: ... if sys.platform == "win32": - if sys.version_info >= (3, 8): - def startfile(path: StrOrBytesPath, operation: str | None = None) -> None: ... + if sys.version_info >= (3, 10): + def startfile( + filepath: StrOrBytesPath, + operation: str = ..., + arguments: str = "", + cwd: StrOrBytesPath | None = None, + show_cmd: int = 1, + ) -> None: ... else: - def startfile(filepath: StrOrBytesPath, operation: str | None = None) -> None: ... + def startfile(filepath: StrOrBytesPath, operation: str = ...) -> None: ... else: def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...