diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index d2bc50ecd..a691cba20 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -3,7 +3,7 @@ import sys from _typeshed import StrOrBytesPath, StrPath, SupportsRead, SupportsWrite from typing import Any, AnyStr, Callable, Iterable, NamedTuple, Sequence, TypeVar, Union, overload -_PathT = TypeVar("_PathT", str, os.PathLike[str]) +_PathT = TypeVar("_PathT", str, bytes, os.PathLike[str], os.PathLike[bytes]) # Return value of some functions that may either return a path-like object that was passed in or # a string _PathReturn = Any @@ -16,7 +16,7 @@ class ReadError(OSError): ... class RegistryError(Exception): ... def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = ...) -> None: ... -def copyfile(src: StrPath, dst: _PathT, *, follow_symlinks: bool = ...) -> _PathT: ... +def copyfile(src: StrOrBytesPath, dst: _PathT, *, follow_symlinks: bool = ...) -> _PathT: ... def copymode(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> None: ... def copystat(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> None: ... def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ...