Skip to content

Commit 1aa0c59

Browse files
authored
Merge branch 'tencentyun:master' into master
2 parents d60d6e5 + ac9f01c commit 1aa0c59

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

qcloud_cos/cos_client.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ def __init__(self, Appid=None, Region=None, SecretId=None, SecretKey=None, Token
9494
if (Scheme != u'http' and Scheme != u'https'):
9595
raise CosClientError('Scheme can be only set to http/https')
9696
self._scheme = Scheme
97-
98-
# 客户使用全球加速域名时,只会传endpoint不会传region。此时这样endpointCi和region同时为None,就会报错。
99-
if EndpointCi is not None:
100-
# 格式化ci的endpoint 不支持自定义域名的
101-
self._endpoint_ci = format_endpoint(EndpointCi, Region, u'ci.')
97+
98+
# 格式化ci的endpoint 不支持自定义域名的
99+
self._endpoint_ci = format_endpoint(EndpointCi, Region, u'ci.')
102100

103101
# 兼容(SecretId,SecretKey)以及(AccessId,AccessKey)
104102
if (SecretId and SecretKey):
@@ -1132,7 +1130,7 @@ def restore_object(self, Bucket, Key, RestoreRequest={}, **kwargs):
11321130
auth=CosS3Auth(self._conf, Key, params=params),
11331131
headers=headers,
11341132
params=params)
1135-
return rt
1133+
return None
11361134

11371135
def select_object_content(self, Bucket, Key, Expression, ExpressionType, InputSerialization, OutputSerialization,
11381136
RequestProgress=None, **kwargs):
@@ -2404,7 +2402,7 @@ def put_bucket_domain(self, Bucket, DomainConfiguration={}, **kwargs):
24042402
auth=CosS3Auth(self._conf, params=params),
24052403
headers=headers,
24062404
params=params)
2407-
return rt
2405+
return None
24082406

24092407
def get_bucket_domain(self, Bucket, **kwargs):
24102408
"""获取bucket 自定义域名配置

qcloud_cos/cos_comm.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,18 @@ def format_values(data):
221221

222222

223223
def format_endpoint(endpoint, region, module=u'cos.'):
224-
"""格式化终端域名"""
225-
if not endpoint and not region:
224+
# 客户使用全球加速域名时,只会传endpoint不会传region。此时这样endpointCi和region同时为None,就会报错。
225+
if not endpoint and not region and module == u'cos.':
226226
raise CosClientError("Region or Endpoint is required not empty!")
227-
if not endpoint:
227+
228+
"""格式化终端域名"""
229+
if endpoint:
230+
return to_unicode(endpoint)
231+
elif region:
228232
region = format_region(region, module)
229233
return u"{region}.myqcloud.com".format(region=region)
230234
else:
231-
return to_unicode(endpoint)
235+
return None
232236

233237

234238
def format_region(region, module=u'cos.'):

qcloud_cos/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '5.1.9.10'
1+
__version__ = '5.1.9.11'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def long_description():
1616

1717
setup(
1818
name='cos-python-sdk-v5',
19-
version='1.9.10',
19+
version='1.9.11',
2020
url='https://www.qcloud.com/',
2121
license='MIT',
2222
author='tiedu, lewzylu, channingliu',

ut/test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,8 +1817,6 @@ def test_sse_c_file():
18171817
'Tier': 'Expedited'
18181818
}
18191819
}, SSECustomerAlgorithm='AES256', SSECustomerKey=ssec_key, SSECustomerKeyMD5=ssec_key_md5)
1820-
print(response)
1821-
assert(response.status_code == 202)
18221820

18231821
# 测试大文件高级上传,走多段
18241822
gen_file('sdk-sse-c-big.local', 21)

0 commit comments

Comments
 (0)