mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 03:22:32 +08:00
Accept bytes paths in shutil.copyfile (#6841)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user