Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,13 +1398,11 @@ def _get_partial_object(self, bucket_name, object_name,
)
headers['Range'] = 'bytes=' + request_range

response = self._url_open('GET',
bucket_name=bucket_name,
object_name=object_name,
headers=headers,
preload_content=False)

return response
return self._url_open('GET',
bucket_name=bucket_name,
object_name=object_name,
headers=headers,
preload_content=False)

def _do_put_object(self, bucket_name, object_name, part_data,
part_size, upload_id='', part_number=0,
Expand Down
7 changes: 4 additions & 3 deletions tests/functional/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ def test_thread_safe(client, test_file, log_output):
thrd = Thread(target=client.fput_object,
args=(bucket_name, object_name, test_file))
thrd.start()
thrd.join()
# Create a wrapper method to capture get_object api's return
# value during threading by introducing a list object to hold
# the return value from each call. Without this, the return
Expand All @@ -1383,8 +1384,8 @@ def threaded_get_object(cli, bckt_name, obj_name, obj_data):
# Create dynamic/varying names for to be created threads
thrd_name = 'thread_'+str(i)
vars()[thrd_name] = Thread(target=threaded_get_object,
args=(client, bucket_name,
object_name, obj_data))
args=(client, bucket_name,
object_name, obj_data))
vars()[thrd_name].start()
thrd_list.append(vars()[thrd_name])
# Wait until all threads to finish
Expand All @@ -1404,7 +1405,7 @@ def threaded_get_object(cli, bckt_name, obj_name, obj_data):
raise Exception(err)
finally:
try:
os.remove('copied_file')
os.path.isfile('copied_file') and os.remove('copied_file')
client.remove_object(bucket_name, object_name)
client.remove_bucket(bucket_name)
except Exception as err:
Expand Down