Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion S3/S3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,11 @@ def recv_file(self, request, stream, labels, start_position = 0, retries = _max_
progress.current_position = current_position

try:
# Fix for issue #432. Even when content size is 0, httplib expect the response to be read.
if size_left == 0:
data = http_response.read(1)
# It is not supposed to be some data returned in that case
assert(len(data) == 0)
while (current_position < size_total):
this_chunk = size_left > self.config.recv_chunk and self.config.recv_chunk or size_left

Expand All @@ -1323,7 +1328,7 @@ def recv_file(self, request, stream, labels, start_position = 0, retries = _max_

data = http_response.read(this_chunk)
if len(data) == 0:
raise S3Error("EOF from S3!")
raise S3ResponseError("EOF from S3!")

#throttle
if self.config.limitrate > 0:
Expand Down