You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def _read_file_chunks(fn: str, chunksz: int = 0x80000) -> Iterator[bytes]:
with open(fn, "rb") as fd:
while 1:
buf = fd.read(chunksz)
if buf:
yield buf
else:
break
Which is passed into a Response to achieve downloading chunking like this:
On the LVFS we have the following code:
Which is passed into a
Response
to achieve downloading chunking like this:I think
Iterator[bytes]
is sane, according tohttps://mypy.readthedocs.io/en/stable/kinds_of_types.html#generators
but mypy reports:Perhaps stream_with_context() needs the additional
Iterator[bytes]
added to theUnion[]
?Environment:
The text was updated successfully, but these errors were encountered: