Don't check if offset is divisible by limit if limit is None

Should fix #3058.
This commit is contained in:
Lonami 2021-05-16 22:27:29 +02:00 committed by GitHub
parent 85381713b2
commit 3d350c6087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -703,7 +703,7 @@ class DownloadMethods:
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)