error parse bytes
ERROR:asyncio:Unhandled exception in event loop
Traceback (most recent call last):
File "winloop\dns.pyx", line 448, in winloop.loop.__on_addrinfo_resolved
File "winloop\errors.pyx", line 72, in winloop.loop.convert_error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdd in position 0: invalid continuation byte
the error appears when I use winloop together in psycopg[binary] version 3.2.1
it was a problem on my part
Hi, @IvanKirpichnikov! How did you fix it?
Hello. No way. I thought that the problem was on my side, but after a while I realized that it was not on my side.
As a result, I threw out winloop, because the project will still be deployed on Linux :D
Reopen the issue please
Reopen the issue please
done
@IvanKirpichnikov Sorry for a year of waiting I may have come up with a solution.
msg = system.gai_strerror(sock_err).decode('utf-8', errors="surrogatescape")
do you think surrogateescape will pass 0xdd?
@IvanKirpichnikov Sorry for a year of waiting I may have come up with a solution.
msg = system.gai_strerror(sock_err).decode('utf-8', errors="surrogatescape")
do you think surrogateescape will pass 0xdd?
Hi. Thanks for the solution, but I can't test it. I switched to linux =(
I think I should have attached the MRE.
All I know is winloop==0.1.6 was used together with psycopg[binary]==3.2.1. And the problem appeared when connecting to PostgreSQL. It may have appeared when an unsuccessful attempt was made to connect to the database.
I think I should have attached the MRE.
All I know is winloop==0.1.6 was used together with psycopg[binary]==3.2.1. And the problem appeared when connecting to PostgreSQL. It may have appeared when an unsuccessful attempt was made to connect to the database.
@IvanKirpichnikov I wrote a reproducible test that should work on any os in the pull request. should also work on linux but incase I'll copy and paste that same snippet here.
e = b'\xdd'
print(e.decode('utf-8',"surrogateescape"))