core icon indicating copy to clipboard operation
core copied to clipboard

Python 3.11 - Exception importing homeassistant.components.snapcast.media_player

Open VDRainer opened this issue 2 years ago • 2 comments

The problem

Tried Python 3.11 venv for the first time. At a first glance, everything but snapcast seems to work for me. :smile:

What version of Home Assistant Core has the issue?

core-2023.3.0b3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Snapcast

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-02-26 13:20:09.611 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform homeassistant.components.snapcast.media_player
Traceback (most recent call last):
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/loader.py", line 779, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/loader.py", line 796, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/components/snapcast/media_player.py", line 7, in <module>
    import snapcast.control
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/__init__.py", line 4, in <module>
    from snapcast.control.server import Snapserver, CONTROL_PORT
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/server.py", line 7, in <module>
    from snapcast.control.client import Snapclient
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/client.py", line 10, in <module>
    class Snapclient(object):
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/client.py", line 59, in Snapclient
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
2023-02-26 13:20:09.619 ERROR (MainThread) [homeassistant.config] Platform error: media_player
Traceback (most recent call last):
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/loader.py", line 779, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/loader.py", line 796, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/components/snapcast/media_player.py", line 7, in <module>
    import snapcast.control
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/__init__.py", line 4, in <module>
    from snapcast.control.server import Snapserver, CONTROL_PORT
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/server.py", line 7, in <module>
    from snapcast.control.client import Snapclient
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/client.py", line 10, in <module>
    class Snapclient(object):
  File "/srv/ha_py311/lib/python3.11/site-packages/snapcast/control/client.py", line 59, in Snapclient
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/config.py", line 928, in async_process_component_config
    platform = p_integration.get_platform(domain)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/ha_py311/lib/python3.11/site-packages/homeassistant/loader.py", line 788, in get_platform
    raise ImportError(
ImportError: Exception importing homeassistant.components.snapcast.media_player

Additional information

No response

VDRainer avatar Feb 26 '23 12:02 VDRainer

python-snapcast issue, see happyleavesaoc/python-snapcast/issues/51

luar123 avatar Feb 26 '23 16:02 luar123