diff --git a/qcloud_cos/cos_client.py b/qcloud_cos/cos_client.py index 79023f1..0c1b6d0 100644 --- a/qcloud_cos/cos_client.py +++ b/qcloud_cos/cos_client.py @@ -453,7 +453,7 @@ def send_request(self, method, url, bucket=None, timeout=30, cos_request=True, c info['requestid'] = res.headers['x-cos-request-id'] if 'x-cos-trace-id' in res.headers: info['traceid'] = res.headers['x-cos-trace-id'] - logger.warn(info) + logger.warning(info) if len(exception_logbuf) > 0: logger.exception(exception_logbuf) # 最终重试失败, 输出前几次重试失败的exception raise CosServiceError(method, info, res.status_code) diff --git a/qcloud_cos/crypto.py b/qcloud_cos/crypto.py index a3f707c..22311b2 100644 --- a/qcloud_cos/crypto.py +++ b/qcloud_cos/crypto.py @@ -202,7 +202,7 @@ def __init__(self, key_pair_info=None, cipher=AESCTRCipher(), passphrase=None): # 为用户自动创建rsa if self.__encrypt_obj is None and self.__decrypt_obj is None: - logger.warn('fail to get rsa key, will generate key') + logger.warning('fail to get rsa key, will generate key') private_key = RSA.generate(2048) public_key = private_key.publickey() @@ -302,7 +302,7 @@ def init_ed_obj(self): self.__ed_obj = AES.new(aes_key, AES.MODE_CTR, counter=self.__my_counter) if self.__ed_obj is None: - logger.warn('fail to get aes key, will generate key') + logger.warning('fail to get aes key, will generate key') aes_key = random_key(_AES_256_KEY_SIZE) self.__ed_obj = AES.new(aes_key, AES.MODE_CTR, counter=self.__my_counter) if not os.path.exists(default_aes_dir):