Closed Thempra closed 6 years ago
GitMate.io thinks possibly related issues are https://github.com/aio-libs/aiohttp/issues/1731 (UnicodeEncodeError: 'utf-8' codec can't encode character '\udca9'), https://github.com/aio-libs/aiohttp/issues/207 (UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc3' in position 60: surrogates not allowed), https://github.com/aio-libs/aiohttp/issues/1750 (Encoding is always UTF-8 in POST data), https://github.com/aio-libs/aiohttp/issues/18 (Auto-decoding doesn't recognize content-type: application/json; charset=utf-8), and https://github.com/aio-libs/aiohttp/issues/1802 (response.text() crash if body contain non UTF-8 symbol).
You are trying to fetch GIF as UTF-8 encoded text. Obviously, this is an error. What behavior do you expect?
rewrite again and now it's ok, thx !!
async def fetch(session, url):
async with session.get(url) as response:
return await response.content.read()
Long story short
When request a call to some servers, a coding error occurs instead download the image / content
Actual behaviour
Steps to reproduce
Your environment
Python 3.7.0 aiohttp 3.4.4