You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
requests.utils.get_encoding_from_headers assumes that the charset parameter always specifies a name. In very rare cases a server can send a malformed content-type header which does not specify a name. In these cases, requests should probably just treat it as if no charset had been specified.
File ~/opt/anaconda3/2023.03/envs/mamba/envs/py3/lib/python3.9/site-packages/requests/utils.py:553, in get_encoding_from_headers(headers)
550 content_type, params = _parse_content_type_header(content_type)
552 if "charset" in params:
--> 553 return params["charset"].strip("'\"")
555 if "text" in content_type:
556 return "ISO-8859-1"
AttributeError: 'bool' object has no attribute 'strip'
requests.utils.get_encoding_from_headers
assumes that the charset parameter always specifies a name. In very rare cases a server can send a malformed content-type header which does not specify a name. In these cases, requests should probably just treat it as if no charset had been specified.Expected Result
requests.utils.get_encoding_from_headers({'content-type': 'text/html; charset'}) == 'ISO-8859-1'
Actual Result
System Information
The text was updated successfully, but these errors were encountered: