Skip to content

Help - error when using Aiohttp with headers #414

Answered by devachnid
devachnid asked this question in Q&A
Discussion options

You must be logged in to vote

SOLVED!

In case anyone else comes across this I solved it by running the script in Python directly, which showed the true underlying error:

Traceback (most recent call last):
  File "/root/switchbot.py", line 47, in <module>
    loop.run_until_complete(main())
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/root/switchbot.py", line 40, in main
    async with session.get(url=get_url) as response:
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 558, in _request
    resp = …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by devachnid
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants