-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
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
How to debug UnicodeDecodeError? #16
Comments
Hi there, The current output is indeed not very useful. I added logging of the exception in the following in order to investigate this issue. I suppose that the problem here is encoding of emojis. All the pages that you list above contain at least one emoji character. ERROR:deadseeker.loggingresponsehandler:::error ::UnicodeDecodeError: 200 - https://phpstan.org/blog/phpstan-is-ready-for-php8
Traceback (most recent call last):
File "/modules/deadseeker/responsefetcher.py", line 42, in fetch_response
await self._inner_fetch(session, resp, urltarget, timer)
File "/modules/deadseeker/responsefetcher.py", line 98, in _inner_fetch
await self._do_get(session, resp, urltarget, timer)
File "/modules/deadseeker/responsefetcher.py", line 71, in _do_get
resp.html = await response.text()
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1081, in text
return self._body.decode(encoding, errors=errors) # type: ignore
File "/usr/local/lib/python3.8/encodings/cp1254.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table) For some reason the auto charset auto detection thinks your page is encoded using
|
There are the following options to fix this:
I think solution 2 is fine. |
@ondrejmirtes can you check if the Pull Request #20 works for you? I just checked with your config and it seems to work. However, you have at least one broken link on your page 😄 This page you link to seems to be down |
Yes, it works for me, it's green now! :) https://github.com/phpstan/phpstan/runs/7297099734?check_suite_focus=true Thank you very much for your swift response. |
From aio-libs/aiohttp#5930 it looks like the solution I picked (i.e. defaulting to "utf-8") is not optimal. Instead updating to aio-http >3.8 should work here too. |
Hello,
I really appreciate your action, it's really useful!
I'm getting
UnicodeDecodeError
for a few or my pages (https://github.com/phpstan/phpstan/runs/7283991324?check_suite_focus=true):Which normally work fine and I'm not sure how to debug this. Can you please tell me some steps how to fix it? Thanks :)
The text was updated successfully, but these errors were encountered: