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

Insteon with 2448A7: "SyntaxError: invalid syntax" when initializing component #16644

Closed
synthead opened this issue Sep 16, 2018 · 7 comments
Closed

Comments

@synthead
Copy link

Home Assistant release with the issue: 0.77.3

Last working Home Assistant release (if known): n/a

Operating environment (Hass.io/Docker/Windows/etc.): Arch Linux

Component/platform: Insteon

Description of problem: Python exception is raised when initializing Insteon component (see backtrace)

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

insteon:
  port: /dev/ttyUSB2

Traceback (if applicable):

2018-09-15 22:58:05 INFO (MainThread) [homeassistant.setup] Setting up insteon
2018-09-15 22:58:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component insteon
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
    hass, processed_config)
  File "/usr/lib/python3.7/site-packages/homeassistant/components/insteon/__init__.py", line 143, in async_setup
    import insteonplm
  File "/var/lib/hass/deps/lib/python3.7/site-packages/insteonplm/__init__.py", line 22
    ensure_future = asyncio.async
                                ^
SyntaxError: invalid syntax
@scop
Copy link
Member

scop commented Sep 16, 2018

Looks like insteonplm is not ready for Python 3.7: nugget/python-insteonplm#107
Until it is, I suggest trying with 3.6.x.

@scop scop closed this as completed Sep 16, 2018
@scop
Copy link
Member

scop commented Sep 16, 2018

More 3.7 WIP in #15479

@synthead
Copy link
Author

Found a workaround. Edit deps/lib/python3.7/site-packages/insteonplm/__init__.py and change this:

try:
    ensure_future = asyncio.ensure_future
except AttributeError:
    ensure_future = asyncio.async

...to just this:

ensure_future = asyncio.ensure_future

@scop
Copy link
Member

scop commented Sep 17, 2018

Or better IMO, apply the change from the above mentioned insteonplm PR:
nugget/python-insteonplm@f77c141

@teharris1
Copy link
Contributor

Thanks for finding this issue with 3.7. Currently the lowest release supported by insteonplm is 3.4. Hence the different future scheduling. I will take a look at the PR mentioned. if this is the only issue the I can turn something around quickly to support 3.7.

@scop
Copy link
Member

scop commented Sep 17, 2018

As mentioned in the PR, a bunch of test failures remain after that change, so it's likely that some more work is needed. https://travis-ci.org/nugget/python-insteonplm/jobs/429158686

@teharris1
Copy link
Contributor

Yeah, looks like 3.7 requires 3.5.3 syntax for async and await rather than coroutines and yield from. That is a bigger change. This means dropping 3.4 support I believe. but it is probably time for that anyway.

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

No branches or pull requests

3 participants