Skip to content

Commit

Permalink
Don't check if offset is divisible by limit if limit is None
Browse files Browse the repository at this point in the history
Should fix #3058.
  • Loading branch information
Lonami committed May 16, 2021
1 parent 8538171 commit 3d350c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion telethon/client/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def _iter_download(
if chunk_size == request_size \
and offset % MIN_CHUNK_SIZE == 0 \
and stride % MIN_CHUNK_SIZE == 0 \
and offset % limit == 0:
and (limit is None or offset % limit == 0):
cls = _DirectDownloadIter
self._log[__name__].info('Starting direct file download in chunks of '
'%d at %d, stride %d', request_size, offset, stride)
Expand Down

0 comments on commit 3d350c6

Please sign in to comment.