Skip to content

Commit 0dee8fa

Browse files
[boltons] Accept supported string and path-like file inputs
1 parent 950d5b1 commit 0dee8fa

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎stubs/boltons/boltons/fileutils.pyi‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from _typeshed import BytesPath, StrOrBytesPath, StrPath
22
from collections.abc import Callable, Generator, Iterable
3-
from os import PathLike
43
from types import TracebackType
54
from typing import IO, Any, TypeVar, overload
65
from typing_extensions import Never, Self
@@ -9,7 +8,7 @@ _StrPathT = TypeVar("_StrPathT", bound=StrPath)
98
_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath)
109

1110
def mkdir_p(path: StrOrBytesPath) -> None: ...
12-
def rotate_file(filename: PathLike[str], *, keep: int = 5) -> None: ...
11+
def rotate_file(filename: StrPath, *, keep: int = 5) -> None: ...
1312

1413
class FilePerms:
1514
user: str
@@ -22,7 +21,7 @@ class FilePerms:
2221
def from_path(cls, path: StrOrBytesPath) -> Self: ...
2322
def __int__(self) -> int: ...
2423

25-
def atomic_save(dest_path: str, **kwargs) -> AtomicSaver: ...
24+
def atomic_save(dest_path: StrPath, **kwargs) -> AtomicSaver: ...
2625

2726
class AtomicSaver:
2827
dest_path: str
@@ -38,7 +37,7 @@ class AtomicSaver:
3837
mode: str
3938
open_flags: int
4039
part_file: IO[Any] | None
41-
def __init__(self, dest_path: str, **kwargs) -> None: ...
40+
def __init__(self, dest_path: StrPath, **kwargs) -> None: ...
4241
def setup(self) -> None: ...
4342
def __enter__(self) -> IO[Any]: ...
4443
def __exit__(

0 commit comments

Comments
 (0)