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
Hello Guy! Cool project. I am using some of your code as a reference while making my own project - something to display images from the MET on my Meural. I don't have the home assistant so I'm just robbing some of your python code to make it work.
Anyway I found an bug that I think I should tell you about, in case you hit it. I got AIOHTTP to choke on some image file and crash. This is from LocalMeural.sendPostcard
if you give it this url, aiohttp crashes https://images.metmuseum.org/CRDImages/ep/original/DT1567.jpg
[22-03-19-0:03:51 ladyred] ~/Code/Meural > python3 main.py
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 898, in start
message, payload = await protocol.read() # type: ignore[union-attr]
File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 616, in read
await self._waiter
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_proto.py", line 213, in data_received
messages, upgraded, tail = self._parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadHttpMessage: 400, message='Invalid header value char'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "main.py", line 21, in <module>
asyncio.run(main())
File "/usr/local/Cellar/[email protected]/3.8.8_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/Cellar/[email protected]/3.8.8_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "main.py", line 16, in main
gal_stat = await lm.send_postcard(URL, "image/jpeg")
File "/Users/ladyred/Code/Meural/meural/pymeural.py", line 190, in send_postcard
response = await self.session.get(url)
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 559, in _request
await resp.start(conn)
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 900, in start
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Invalid header value char', url=URL('https://images.metmuseum.org/CRDImages/ep/original/LC-EP_1993_132_suppl_CH-001.jpg')
So I think it is some bug with aiohttp - that it can't handle the response of the server. Maybe it is based on aiohttp version? I have a pretty recent version.
PS my man, did you ever find a solution to the canvas showing the previous uploaded postcard when you hit the remote endpoint? I guess it is a meural bug but did you find any workaround?
The text was updated successfully, but these errors were encountered:
Hey! I did not find a solution to the previous uploaded postcard issue - mainly because, strangely enough, I have never encountered it - but @sanghviharshit has. Check out his PR for a workaround: #51
Hello Guy! Cool project. I am using some of your code as a reference while making my own project - something to display images from the MET on my Meural. I don't have the home assistant so I'm just robbing some of your python code to make it work.
Anyway I found an bug that I think I should tell you about, in case you hit it. I got AIOHTTP to choke on some image file and crash. This is from LocalMeural.sendPostcard
if you give it this url, aiohttp crashes
https://images.metmuseum.org/CRDImages/ep/original/DT1567.jpg
So I think it is some bug with aiohttp - that it can't handle the response of the server. Maybe it is based on aiohttp version? I have a pretty recent version.
Anyway, you may hit it if you try this data source (the met) or that aiohttp version.
PS I rewrote it with requests library and it works fine. So it is a library issue
PS my man, did you ever find a solution to the canvas showing the previous uploaded postcard when you hit the remote endpoint? I guess it is a meural bug but did you find any workaround?
The text was updated successfully, but these errors were encountered: