Skip to content

Commit 9a923a0

Browse files
committed
It seems sendfile() and statvfs() are available on Windows?
1 parent 1361989 commit 9a923a0

1 file changed

Lines changed: 21 additions & 27 deletions

File tree

stubs/aiofiles/aiofiles/os.pyi

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import sys
21
from _typeshed import BytesPath, FileDescriptorOrPath, GenericPath, ReadableBuffer, StrOrBytesPath, StrPath
32
from asyncio.events import AbstractEventLoop
43
from collections.abc import Sequence
5-
from os import _ScandirIterator, stat_result
4+
from os import _ScandirIterator, stat_result, statvfs_result
65
from typing import Any, AnyStr, overload
76

87
from aiofiles import ospath
@@ -11,6 +10,7 @@ from aiofiles.ospath import wrap as wrap
1110
__all__ = [
1211
"path",
1312
"stat",
13+
"statvfs",
1414
"rename",
1515
"renames",
1616
"replace",
@@ -26,12 +26,10 @@ __all__ = [
2626
"listdir",
2727
"scandir",
2828
"access",
29+
"sendfile",
2930
"wrap",
3031
]
3132

32-
if sys.platform != "win32":
33-
__all__ += ["statvfs", "sendfile"]
34-
3533
path = ospath
3634

3735
async def stat(
@@ -118,25 +116,21 @@ async def listdir(path: int, *, loop: AbstractEventLoop | None = ..., executor:
118116
async def access(
119117
path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True
120118
) -> bool: ...
121-
122-
if sys.platform != "win32":
123-
from os import statvfs_result
124-
125-
@overload
126-
async def sendfile(
127-
out_fd: int, in_fd: int, offset: int | None, count: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
128-
) -> int: ...
129-
@overload
130-
async def sendfile(
131-
out_fd: int,
132-
in_fd: int,
133-
offset: int,
134-
count: int,
135-
headers: Sequence[ReadableBuffer] = ...,
136-
trailers: Sequence[ReadableBuffer] = ...,
137-
flags: int = ...,
138-
*,
139-
loop: AbstractEventLoop | None = ...,
140-
executor: Any = ...,
141-
) -> int: ... # FreeBSD and Mac OS X only
142-
async def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only
119+
@overload
120+
async def sendfile(
121+
out_fd: int, in_fd: int, offset: int | None, count: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...
122+
) -> int: ...
123+
@overload
124+
async def sendfile(
125+
out_fd: int,
126+
in_fd: int,
127+
offset: int,
128+
count: int,
129+
headers: Sequence[ReadableBuffer] = ...,
130+
trailers: Sequence[ReadableBuffer] = ...,
131+
flags: int = ...,
132+
*,
133+
loop: AbstractEventLoop | None = ...,
134+
executor: Any = ...,
135+
) -> int: ... # FreeBSD and Mac OS X only
136+
async def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only

0 commit comments

Comments
 (0)