aliyun / aliyun-openapi-python-sdk

Alibaba Cloud SDK for Python
Other
1.01k stars 588 forks source link

python3 aliyun-python-sdk-green encoding or errors without a string argument #91

Closed laodaxyz closed 5 years ago

laodaxyz commented 6 years ago

python:3.6.5 aliyun-python-sdk-core-v3==2.8.9 aliyun-python-sdk-green==3.2.0

puthon ImageAsyncScanRequestSample.py

Traceback (most recent call last): File ".\ImageAsyncScanRequestSample.py", line 22, in response = clt.do_action_with_exception(request) File "C:\Python36\lib\site-packages\aliyunsdkcore\client.py", line 259, in do_action_with_exception status, headers, body = self.implementation_of_do_action(acs_request) File "C:\Python36\lib\site-packages\aliyunsdkcore\client.py", line 225, in implementation_of_do_action http_response = self._make_http_response(endpoint, request, signer) File "C:\Python36\lib\site-packages\aliyunsdkcore\client.py", line 187, in _make_http_response header, url = signer.sign(self.__region_id, request) File "C:\Python36\lib\site-packages\aliyunsdkcore\auth\signers\access_key_signer.py", line 31, in sign header = request.get_signed_header(region_id, cred.access_key_id, cred.access_key_secret) File "C:\Python36\lib\site-packages\aliyunsdkcore\request.py", line 383, in get_signed_header md5_str = md5_tool.get_md5_base64_str(self.get_content()) File "C:\Python36\lib\site-packages\aliyunsdkcore\auth\utils\md5_tool.py", line 39, in get_md5_base64_str return str(base64.encodebytes(_get_md5(content)).strip(), "utf-8") File "C:\Python36\lib\site-packages\aliyunsdkcore\auth\utils\md5_tool.py", line 34, in _get_md5 m.update(bytearray(content, "utf-8")) TypeError: encoding or errors without a string argument

Qingtang-SDK commented 5 years ago

I assume you are using ImageAsyncScanRequestSample.py from: https://www.alibabacloud.com/help/zh/doc-detail/53425.htm

Qingtang-SDK commented 5 years ago

Hi, @laodaxyz This bug has been fixed in our newest SDK version, please update your `aliyun-python-sdk-core (yes, now it's compatible with Python 2.x and 3.x) to the newest version and try again.

Thanks for your feedback. Any further questions, please let us know.