Skip to content

Commit

Permalink
fallback to partial read if seek not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
snopoke committed Apr 21, 2020
1 parent 7c5d4bf commit 05cadf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions corehq/util/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def _partial_read(current_position, stop):

yield data

if hasattr(self.filelike, 'seek'):
try:
self.filelike.seek(self.start)
else:
except (AttributeError, ValueError):
list(itertools.dropwhile(lambda x: True, _partial_read(0, self.start)))

for data in _partial_read(self.start, self.stop):
Expand Down

0 comments on commit 05cadf1

Please sign in to comment.