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

MPD + Python 3.10 = Unexpected keyword argument 'loop' #59006

Closed
rursache opened this issue Nov 3, 2021 · 6 comments · Fixed by #69304
Closed

MPD + Python 3.10 = Unexpected keyword argument 'loop' #59006

rursache opened this issue Nov 3, 2021 · 6 comments · Fixed by #69304

Comments

@rursache
Copy link

rursache commented Nov 3, 2021

The problem

Hello,

I've updated to Python 3.10 and installed HA 2021.11.0 but now im getting

2021-11-03 22:12:06 ERROR (MainThread) [homeassistant.components.media_player] mpd: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
await entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 651, in async_device_update
await task
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/mpd/media_player.py", line 164, in async_update
await self._connect()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/mpd/media_player.py", line 122, in _connect
await self._client.connect(self.server, self.port)
File "/srv/homeassistant/lib/python3.10/site-packages/mpd/asyncio.py", line 195, in connect
r, w = await asyncio.open_connection(host, port, loop=loop)
File "/usr/lib/python3.10/asyncio/streams.py", line 47, in open_connection
transport, _ = await loop.create_connection(
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'

error at startup and my android integration is broken

What version of Home Assistant Core has the issue?

2021.11.0

What was the last working version of Home Assistant Core?

2021.10.6 with Python 3.8.9

What type of installation are you running?

Home Assistant Core

Integration causing the issue

MPD

Link to integration documentation on our website

https://www.home-assistant.io/integrations/mpd/

Example YAML snippet

media_player:
  - platform: androidtv
    name: Proiector Android
    device_class: androidtv
    host: 192.168.31.180
    port: 5555
    turn_off_command: "reboot -p"
  - platform: mpd
    host: 192.168.31.100

Anything in the logs that might be useful for us?

Full startup log:

2021-11-03 22:12:03 WARNING (Recorder) [homeassistant.components.recorder.util] Version 3.27.2 of SQLite is not supported; minimum supported version is 3.32.1. Starting with Home Assistant 2022.2 this will prevent the recorder from starting. Please upgrade your database software before then
2021-11-03 22:12:06 ERROR (MainThread) [homeassistant.components.media_player] mpd: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
await entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 651, in async_device_update
await task
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/mpd/media_player.py", line 164, in async_update
await self._connect()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/mpd/media_player.py", line 122, in _connect
await self._client.connect(self.server, self.port)
File "/srv/homeassistant/lib/python3.10/site-packages/mpd/asyncio.py", line 195, in connect
r, w = await asyncio.open_connection(host, port, loop=loop)
File "/usr/lib/python3.10/asyncio/streams.py", line 47, in open_connection
transport, _ = await loop.create_connection(
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'

Additional information

The line

2021-11-03 22:12:03 WARNING (Recorder) [homeassistant.components.recorder.util] Version 3.27.2 of SQLite is not supported; minimum supported version is 3.32.1. Starting with Home Assistant 2022.2 this will prevent the recorder from starting. Please upgrade your database software before then

also appeared since updating to Python 3.10 but i don't know if its related to this or i need to submit a new issue. if i run sudo apt install sqlite3 it says i'm running the latest version

@probot-home-assistant
Copy link

mpd documentation
mpd source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @fabaff, mind taking a look at this issue as it has been labeled with an integration (mpd) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@MatthewFlamm
Copy link
Contributor

Looks like an issue in the upstream library. A fix looks to have been made but I don't think a release is available.

See Mic92/python-mpd2#181

@github-actions
Copy link

github-actions bot commented Feb 9, 2022

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@azrdev
Copy link
Contributor

azrdev commented Mar 11, 2022

please reopen: Mic92/python-mpd2#181 has been merged and published as v3.0.5, https://github.com/home-assistant/core/blob/dev/homeassistant/components/mpd/manifest.json needs to bump this dependency.

@fuzzznet
Copy link

fuzzznet commented Apr 4, 2022

Home Assistant core-2022.3.8 \ Python 3.10.4

Error:

mpd: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
await entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity.py", line 737, in async_device_update
await task
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/mpd/media_player.py", line 178, in async_update
await self._connect()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/mpd/media_player.py", line 135, in _connect
await self._client.connect(self.server, self.port)
File "/srv/homeassistant/lib/python3.10/site-packages/mpd/asyncio.py", line 195, in connect
r, w = await asyncio.open_connection(host, port, loop=loop)
File "/usr/lib/python3.10/asyncio/streams.py", line 47, in create_connectionopen_connection
transport, _ = await loop.create_connection(
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'loop'

azrdev added a commit to azrdev/home-assistant-core that referenced this issue Apr 4, 2022
fix home-assistant#59006 python3.10 bug Unexpected keyword argument 'loop'
@azrdev azrdev mentioned this issue Apr 4, 2022
22 tasks
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants