diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 76c114591d32..06f73e618180 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -861,7 +861,12 @@ class _wrap_close(_TextIOWrapper): def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ... def close(self) -> int | None: ... # type: ignore[override] -def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ... +if sys.version_info >= (3, 11): + def popen(cmd: str, mode: str = ..., buffering: int = ..., encoding: str | None = ...) -> _wrap_close: ... + +else: + def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _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