Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 53 additions & 12 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1395,19 +1395,48 @@ class _wrap_close:
def write(self, s: str, /) -> int: ...
def writelines(self, lines: Iterable[str], /) -> None: ...

def popen(cmd: str, mode: str = "r", buffering: int = -1) -> _wrap_close: ...
def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
def spawnle(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise sig
if sys.version_info >= (3, 14):
@deprecated("Soft deprecated. Use the subprocess module instead.")
def popen(cmd: str, mode: str = "r", buffering: int = -1) -> _wrap_close: ...
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnle(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise sig

else:
def popen(cmd: str, mode: str = "r", buffering: int = -1) -> _wrap_close: ...
def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
def spawnle(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise sig

if sys.platform != "win32":
def spawnv(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ...
def spawnve(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...
if sys.version_info >= (3, 14):
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnv(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ...
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnve(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...

else:
def spawnv(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ...
def spawnve(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...

else:
if sys.version_info >= (3, 14):
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnv(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, /) -> int: ...
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnve(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, env: _ExecEnv, /) -> int: ...

else:
def spawnv(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, /) -> int: ...
def spawnve(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, env: _ExecEnv, /) -> int: ...

if sys.version_info >= (3, 14):
@deprecated("Soft deprecated. Use the subprocess module instead.")
def system(command: StrOrBytesPath) -> int: ...

else:
def spawnv(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, /) -> int: ...
def spawnve(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, env: _ExecEnv, /) -> int: ...
def system(command: StrOrBytesPath) -> int: ...

def system(command: StrOrBytesPath) -> int: ...
@final
class times_result(structseq[float], tuple[float, float, float, float, float]):
if sys.version_info >= (3, 10):
Expand Down Expand Up @@ -1440,10 +1469,22 @@ if sys.platform == "win32":
def startfile(filepath: StrOrBytesPath, operation: str = ...) -> None: ...

else:
def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
def spawnlpe(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise signature
def spawnvp(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ...
def spawnvpe(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...
if sys.version_info >= (3, 14):
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnlpe(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise signature
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnvp(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ...
@deprecated("Soft deprecated. Use the subprocess module instead.")
def spawnvpe(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...

else:
def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
def spawnlpe(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise signature
def spawnvp(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ...
def spawnvpe(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ...

def wait() -> tuple[int, int]: ... # Unix only
# Added to MacOS in 3.13
if sys.platform != "darwin" or sys.version_info >= (3, 13):
Expand Down