视觉智能平台正常调用人脸搜索,出现了报错,应该怎么调整? response = client.search_face_advance(search_face_request, runtime_option)
File "/usr/local/lib/python3.7/dist-packages/alibabacloud_facebody20191230/client.py", line 9903, in search_face_advance
oss_client.post_object(upload_request, oss_runtime)
File "/usr/local/lib/python3.7/dist-packages/alibabacloud_oss_sdk/client.py", line 9845, in post_object
raise e
File "/usr/local/lib/python3.7/dist-packages/alibabacloud_oss_sdk/client.py", line 9823, in post_object
_response = TeaCore.do_action(_request, _runtime)
File "/usr/local/lib/python3.7/dist-packages/Tea/core.py", line 221, in do_action
cert=cert,
File "/usr/local/lib/python3.7/dist-packages/requests/adapters.py", line 450, in send
timeout=timeout
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, *httplib_request_kw)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/lib/python3.7/http/client.py", line 1260, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1301, in _send_request
self.putheader(hdr, value)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 224, in putheader
_HTTPConnection.putheader(self, header, values)
File "/usr/lib/python3.7/http/client.py", line 1233, in putheader
values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u4e94' in position 0: ordinal not in range(256)
您好,根据错误提示 'latin-1' codec can't encode character '\u4e94' in position 0: ordinal not in range(256) 来看是在尝试将HTTP请求头中的某个值编码为latin-1(也称为ISO-8859-1)时发生的。latin-1是一种只能表示256个字符的编码方式,而中文字符(如\u4e94)的Unicode码点超出了这个范围。建议您检查一下图片URL链接中是否包含有中文字符。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。