diff --git a/qcloud_cos/cos_client.py b/qcloud_cos/cos_client.py index dba080a8..795b944e 100644 --- a/qcloud_cos/cos_client.py +++ b/qcloud_cos/cos_client.py @@ -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