Skip to content

Commit 35ac31c

Browse files
committed
IO is always bytes, I think
1 parent 1ffa9b9 commit 35ac31c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aiohttp/web_fileresponse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ def __init__(
105105
self._path = pathlib.Path(path)
106106
self._chunk_size = chunk_size
107107

108-
def _seek_and_read(self, fobj: IO[Any], offset: int, chunk_size: int) -> bytes:
108+
def _seek_and_read(self, fobj: IO[bytes], offset: int, chunk_size: int) -> bytes:
109109
fobj.seek(offset)
110110
return fobj.read(chunk_size) # type: ignore[no-any-return]
111111

112112
async def _sendfile_fallback(
113-
self, writer: AbstractStreamWriter, fobj: IO[Any], offset: int, count: int
113+
self, writer: AbstractStreamWriter, fobj: IO[bytes], offset: int, count: int
114114
) -> AbstractStreamWriter:
115115
# To keep memory usage low,fobj is transferred in chunks
116116
# controlled by the constructor's chunk_size argument.
@@ -131,7 +131,7 @@ async def _sendfile_fallback(
131131
return writer
132132

133133
async def _sendfile(
134-
self, request: "BaseRequest", fobj: IO[Any], offset: int, count: int
134+
self, request: "BaseRequest", fobj: IO[bytes], offset: int, count: int
135135
) -> AbstractStreamWriter:
136136
writer = await super().prepare(request)
137137
assert writer is not None

0 commit comments

Comments
 (0)