From 5c739ef4c32d093ec0e2f7f8df981dc92f1b52c2 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Tue, 16 Jun 2020 23:57:58 +0100 Subject: [PATCH] os.fsencode(PathLike[AnyStr]) produces AnyStr (#4233) PathLike is generic over AnyStr of 7587e7f1c14464c848d8f6688deae6237a86efa1. Also see 89de36afa4bd75cc49369626e3e8aa3190075042, which changed this to `Any` before `AnyStr` was available. --- stdlib/3/os/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/os/__init__.pyi b/stdlib/3/os/__init__.pyi index 643d79394..a79e95784 100644 --- a/stdlib/3/os/__init__.pyi +++ b/stdlib/3/os/__init__.pyi @@ -320,7 +320,7 @@ if sys.version_info >= (3, 6): @overload def fspath(path: bytes) -> bytes: ... @overload - def fspath(path: PathLike[Any]) -> Any: ... + def fspath(path: PathLike[AnyStr]) -> AnyStr: ... def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str]: ... # NOTE: get_exec_path(): returns List[bytes] when env not None