Skip to content

Commit 50ba099

Browse files
author
huangrihang
committed
bugfix: 修复对象存储文件下载校验不通过时删除对象错误
1 parent 3a1ebd9 commit 50ba099

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

qcloud_sdk/cos/api/object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def download_object_to_file(self, object_key, file_path, bucket=None, region=Non
112112
# TODO:校验结果写入日志,包括CRC64的值、校验结果是否正确。
113113
if not verify_file_crc64(int(headers['x-cos-hash-crc64ecma']), tmp_file_path, file_chunk_size):
114114
# 校验失败文件支持自动清空,以方便捕获异常后重新下载。
115-
os.remove(file_path) if remove_unverified_file else None
115+
os.remove(tmp_file_path) if remove_unverified_file else None
116116
# TODO:换成自定义异常类,以方便被上级程序捕获。
117117
raise ValueError('CRC64校验不通过') if raise_verification_error else None
118118

0 commit comments

Comments
 (0)