diff --git a/qcloud_cos/cos_op.py b/qcloud_cos/cos_op.py index 1af40d8..16fa7b5 100644 --- a/qcloud_cos/cos_op.py +++ b/qcloud_cos/cos_op.py @@ -371,7 +371,8 @@ def _upload_slice_file(self, request): local_path = request.get_local_path() file_size = os.path.getsize(local_path) - slice_size = control_ret[u'data'][u'slice_size'] + if u'slice_size' in control_ret[u'data']: + slice_size = control_ret[u'data'][u'slice_size'] offset = 0 session = control_ret[u'data'][u'session'] # ?concurrency