@@ -245,7 +245,7 @@ def provide_transfer_size(self, transfer_future):
245245 )
246246
247247 def requires_multipart_upload (self , transfer_future , config ):
248- return transfer_future .meta .size >= config .multipart_threshold
248+ return config . multipart_threshold is not None and transfer_future .meta .size >= config .multipart_threshold
249249
250250 def get_put_object_body (self , transfer_future ):
251251 # Get a file-like object for the given input
@@ -393,14 +393,14 @@ def provide_transfer_size(self, transfer_future):
393393 def requires_multipart_upload (self , transfer_future , config ):
394394 # If the user has set the size, we can use that.
395395 if transfer_future .meta .size is not None :
396- return transfer_future .meta .size >= config .multipart_threshold
396+ return config . multipart_threshold is not None and transfer_future .meta .size >= config .multipart_threshold
397397
398398 # This is tricky to determine in this case because we can't know how
399399 # large the input is. So to figure it out, we read data into memory
400400 # up until the threshold and compare how much data was actually read
401401 # against the threshold.
402402 fileobj = transfer_future .meta .call_args .fileobj
403- threshold = config .multipart_threshold
403+ threshold = config .multipart_threshold or 8 * 1024 * 1024
404404 self ._initial_data = self ._read (fileobj , threshold , False )
405405 if len (self ._initial_data ) < threshold :
406406 return False
0 commit comments