aliyun / aliyun/alibabacloud-python-sdk

'utf-8' codec can't decode byte 0xfd in position 63365: invalid start byte

Open
#33 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
139
Forks
38
PR merge metrics
No merged PRs in 30d

Description

`
Traceback (most recent call last):
File "D:\Python\alibabacloud_sample\sample.py", line 55, in main
client.get_logs_with_options('waf-project-1107686368903575-cn-hangzhou', 'waf-logstore', get_logs_request, headers, runtime)
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_sls20201230\client.py", line 10018, in get_logs_with_options
self.execute(params, req, runtime)
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_tea_openapi-0.3.13-py3.10.egg\alibabacloud_tea_openapi\client.py", line 1852, in execute
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_tea_openapi-0.3.13-py3.10.egg\alibabacloud_tea_openapi\client.py", line 1842, in execute
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_gateway_sls-0.3.1-py3.10.egg\alibabacloud_gateway_sls\client.py", line 348, in modify_response
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_tea_util-0.3.13-py3.10.egg\alibabacloud_tea_util\client.py", line 161, in read_as_json
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_tea_util-0.3.13-py3.10.egg\alibabacloud_tea_util\client.py", line 152, in read_as_string
File "C:\Programfiles\Python\3.10.0\lib\site-packages\alibabacloud_tea_util-0.3.13-py3.10.egg\alibabacloud_tea_util\client.py", line 75, in to_string
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 63365: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Python\alibabacloud_sample\sample.py", line 89, in
Sample.main(sys.argv[1:])
File "D:\Python\alibabacloud_sample\sample.py", line 59, in main
chardet.detect(print(error.message))
AttributeError: 'UnicodeDecodeError' object has no attribute 'message'
`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with sample.py and trace the response handling through alibabacloud_gateway_sls/client.py and alibabacloud_tea_util/client.py, especially read_as_string and to_string. Reproduce the failing request and determine the expected handling for the non-UTF-8 response; done should include a verified resolution and correct exception reporting.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.