@@ -105,12 +105,12 @@ def __init__(
105
105
self ._path = pathlib .Path (path )
106
106
self ._chunk_size = chunk_size
107
107
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 :
109
109
fobj .seek (offset )
110
110
return fobj .read (chunk_size ) # type: ignore[no-any-return]
111
111
112
112
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
114
114
) -> AbstractStreamWriter :
115
115
# To keep memory usage low,fobj is transferred in chunks
116
116
# controlled by the constructor's chunk_size argument.
@@ -131,7 +131,7 @@ async def _sendfile_fallback(
131
131
return writer
132
132
133
133
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
135
135
) -> AbstractStreamWriter :
136
136
writer = await super ().prepare (request )
137
137
assert writer is not None
0 commit comments