Skip to content

Commit eb6b89e

Browse files
committed
Ensure proper handling of InvalidRange
1 parent 6ad259e commit eb6b89e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

smart_open/s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,8 @@ def _open_body(self, start=None, stop=None):
589589
if start >= actual_object_size: # empty file or start is past end of file
590590
self._position = self._content_length = actual_object_size
591591
self._body = io.BytesIO()
592-
else:
593-
self._open_body(start=start, stop=actual_object_size)
592+
else: # stop is past end of file: request the correct remainder instead
593+
self._open_body(start=start, stop=actual_object_size - 1)
594594
return
595595

596596
#

0 commit comments

Comments
 (0)