fix aliyun cloud typeerror

This commit is contained in:
Yxn 2018-09-14 10:30:22 +08:00 committed by rallytime
parent bf9c175522
commit a307ae093f
No known key found for this signature in database
GPG Key ID: E8F1A4B90D0DEA19

View File

@ -770,7 +770,7 @@ def _compute_signature(parameters, access_key_secret):
# All aliyun API only support GET method
stringToSign = 'GET&%2F&' + percent_encode(canonicalizedQueryString[1:])
h = hmac.new(access_key_secret + "&", stringToSign, sha1)
h = hmac.new(bytearray(access_key_secret + "&", 'utf-8'), bytearray(stringToSign, 'utf-8'), sha1)
signature = base64.encodestring(h.digest()).strip()
return signature