Skip to content

Commit

Permalink
Account for last dl part task being greater than chunk size
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesls committed Jan 12, 2015
1 parent ed9000b commit 9dabc65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion awscli/customizations/s3/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _queue_writes_for_stream(self, body):
# for only the remaining parts. The other alternative, which is what
# we do here, is to just request the entire chunk size write.
self._context.wait_for_turn(self._part_number)
chunk = body.read(self._chunk_size)
chunk = body.read()
offset = self._part_number * self._chunk_size
LOGGER.debug("Submitting IORequest to write queue.")
self._io_queue.put(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/customizations/s3/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def test_retried_requests_dont_enqueue_writes_twice(self):
self.assertEqual(len(call_args_list), 1)
self.assertEqual(call_args_list[0],
mock.call(('local/file', 0, b'foobar', True)))
success_body.read.assert_called_with(constants.CHUNKSIZE)
success_body.read.assert_called_with()


class TestMultipartDownloadContext(unittest.TestCase):
Expand Down

0 comments on commit 9dabc65

Please sign in to comment.