From 392658b8dd55b9ec98f3ca57ca152849d492ffd8 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 29 Feb 2024 11:15:13 +0300 Subject: [PATCH 1/3] Fix pos-only params in `os` module --- stdlib/os/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 2ea3748737d7..eef52e7a8b3b 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -869,8 +869,8 @@ if sys.platform != "win32": def abort() -> NoReturn: ... # These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: StrOrBytesPath, __arg0: StrOrBytesPath, *args: StrOrBytesPath) -> NoReturn: ... -def execlp(file: StrOrBytesPath, __arg0: StrOrBytesPath, *args: StrOrBytesPath) -> NoReturn: ... +def execl(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... +def execlp(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... # These are: execle(file, *args, env) but env is pulled from the last element of the args. def execle( From e8aa80fab7c3532dfc76947f3ba539e49565575b Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 29 Feb 2024 11:43:24 +0300 Subject: [PATCH 2/3] Update stdlib/os/__init__.pyi Co-authored-by: Alex Waygood --- stdlib/os/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index eef52e7a8b3b..b02504f72952 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -869,8 +869,8 @@ if sys.platform != "win32": def abort() -> NoReturn: ... # These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... -def execlp(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... +def execl(file: StrOrBytesPath, arg0: StrOrBytesPath, /, *args: StrOrBytesPath) -> NoReturn: ... +def execlp(file: StrOrBytesPath, arg0: StrOrBytesPath, /, *args: StrOrBytesPath) -> NoReturn: ... # These are: execle(file, *args, env) but env is pulled from the last element of the args. def execle( From d3abc33853af8d25cb7a6e3b2318aa0b09bc2f00 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 29 Feb 2024 11:54:22 +0300 Subject: [PATCH 3/3] Revert --- stdlib/os/__init__.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index b02504f72952..eef52e7a8b3b 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -869,8 +869,8 @@ if sys.platform != "win32": def abort() -> NoReturn: ... # These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: StrOrBytesPath, arg0: StrOrBytesPath, /, *args: StrOrBytesPath) -> NoReturn: ... -def execlp(file: StrOrBytesPath, arg0: StrOrBytesPath, /, *args: StrOrBytesPath) -> NoReturn: ... +def execl(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... +def execlp(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... # These are: execle(file, *args, env) but env is pulled from the last element of the args. def execle(