Skip to content

Commit 8a93fa7

Browse files
os.popen: add encoding argument for 3.11
python/cpython#92374
1 parent e8b3619 commit 8a93fa7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/os/__init__.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,10 @@ class _wrap_close(_TextIOWrapper):
861861
def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ...
862862
def close(self) -> int | None: ... # type: ignore[override]
863863

864-
def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ...
864+
if sys.version_info >= (3, 11):
865+
def popen(cmd: str, mode: str = ..., buffering: int = ..., encoding: str | None = ...) -> _wrap_close: ...
866+
else:
867+
def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ...
865868
def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
866869
def spawnle(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise sig
867870

0 commit comments

Comments
 (0)