We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The content attribute is always encoded as "utf-8" (source).
content
"utf-8"
However, we've noticed that https://google.com/ (as of 9/29) now returns content encoded as 'ISO-8859-1'.
https://google.com/
This breaks some tests that do an actual http request then play back the result and compare the content attributes.
If you're curious, here is a demo of what happens in a (non-mocked) google.com result:
import requests url = "https://google.com/" res = requests.get(url) print(res.headers['Content-Type']) # 'text/html; charset=ISO-8859-1' print(res.encoding) # 'ISO-8859-1' try: res.content.decode("utf8") except Exception as e: print(e) content = res.content.decode(res.encoding)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The
content
attribute is always encoded as"utf-8"
(source).However, we've noticed that
https://google.com/
(as of 9/29) now returns content encoded as 'ISO-8859-1'.This breaks some tests that do an actual http request then play back the result and compare the content attributes.
If you're curious, here is a demo of what happens in a (non-mocked) google.com result:
The text was updated successfully, but these errors were encountered: