Skip to content
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

Python 3.10 - wait() got an unexpected keyword argument 'loop' #66

Open
rwarner opened this issue Feb 2, 2023 · 3 comments
Open

Python 3.10 - wait() got an unexpected keyword argument 'loop' #66

rwarner opened this issue Feb 2, 2023 · 3 comments

Comments

@rwarner
Copy link

rwarner commented Feb 2, 2023

Just upgraded to 2023.2.0 and also upgraded to Python 3.10.9 and it appears that I run into an error with some Python incompatibility:

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv_3.10.9/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 451, in _async_step
    await getattr(self, handler)()
  File "/srv/homeassistant/homeassistant_venv_3.10.9/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 684, in _async_call_service_step
    await service_task
  File "/srv/homeassistant/homeassistant_venv_3.10.9/lib/python3.10/site-packages/homeassistant/core.py", line 1787, in async_call
    task.result()
  File "/srv/homeassistant/homeassistant_venv_3.10.9/lib/python3.10/site-packages/homeassistant/core.py", line 1824, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/home/homeassistant/.homeassistant/custom_components/variable/__init__.py", line 126, in async_set_variable_service
    yield from asyncio.wait(tasks, loop=hass.loop)
TypeError: wait() got an unexpected keyword argument 'loop'

Doesn't seem like this will be fixed given the other issues filed for this repo. Will be seeking an alternative for storing variables for HASS globally and will update here.

@rwarner
Copy link
Author

rwarner commented Feb 2, 2023

I went into custom_components/variable/__init__.py and changed

line 126 from:

yield from asyncio.wait(tasks, loop=hass.loop)

to

yield from asyncio.wait(tasks)

and now it seems to be working for the time being fyi. Something different with the support in aiohttp or python

@sbrewster2
Copy link

Had the same problem, applied your fix and works for me too.

Thx

@rwarner
Copy link
Author

rwarner commented Jul 10, 2023

Had further issues with Python 3.11, moved over to: https://github.com/Wibias/hass-variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants