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
5 changes: 4 additions & 1 deletion qcloud_cos/cos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,10 @@ def send_request(self, method, url, bucket, timeout=30, cos_request=True, ci_req
if 'data' in kwargs:
body = kwargs['data']
if hasattr(body, 'tell') and hasattr(body, 'seek') and hasattr(body, 'read'):
file_position = body.tell() # 记录文件当前位置
try:
file_position = body.tell() # 记录文件当前位置
except Exception as ioe:
file_position = None
kwargs['data'] = to_bytes(kwargs['data'])
if self._conf._ip is not None and self._conf._scheme == 'https':
kwargs['verify'] = False
Expand Down