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

Construct error, "subcon should be a Construct field" #167

Closed
skorokithakis opened this issue Jan 20, 2018 · 7 comments
Closed

Construct error, "subcon should be a Construct field" #167

skorokithakis opened this issue Jan 20, 2018 · 7 comments

Comments

@skorokithakis
Copy link
Contributor

Attempting to run mirobo start with the latest PyPI version of miio on Python 3.6 (Ubuntu 17.10) produces the following error:

Traceback (most recent call last):
  File "/home/stavros/.local/bin/mirobo", line 7, in <module>
    from miio.vacuum_cli import cli
  File "/home/stavros/.local/lib/python3.6/site-packages/miio/__init__.py", line 2, in <module>
    from miio.protocol import Message, Utils
  File "/home/stavros/.local/lib/python3.6/site-packages/miio/protocol.py", line 179, in <module>
    Const(Int16ub, 0x2131),
  File "/home/stavros/.local/lib/python3.6/site-packages/construct/core.py", line 1277, in __init__
    super(Const, self).__init__(subcon)
  File "/home/stavros/.local/lib/python3.6/site-packages/construct/core.py", line 287, in __init__
    raise TypeError("subcon should be a Construct field")
TypeError: subcon should be a Construct field

It has something to do with the construct package, but I'm not terribly sure what.

@rytilahti
Copy link
Owner

rytilahti commented Jan 20, 2018

construct package changed their API and it broke everything depending on Const types. This is fixed already in master, and after #166 gets merged, a new release which fixes this will be pushed into PyPI too.

@skorokithakis
Copy link
Contributor Author

Ah, thanks Teemu, I looked but I couldn't find a ticket mentioning this, so I opened this one. I'll use master for now.

@rytilahti
Copy link
Owner

Not a thing, I hope that the 0.3.4 will be available from pypi at latest tomorrow, I just want someone to try it out before pushing it everywhere (just in case).

@skorokithakis
Copy link
Contributor Author

For what it's worth, master works for me (it can't communicate with the vacuum, but I think that's the vacuum's problem, not the library's).

@rytilahti
Copy link
Owner

0.3.4 is now released.

@prograde
Copy link

I still get this error. Running on a Raspberry Pi 3.

@rytilahti
Copy link
Owner

rytilahti commented Sep 23, 2019

Which version of python-miio and which version of construct are you running? This should have been fixed more than a year ago, so I doubt it's the same problem.

edit: please open a separate issue for this.

Repository owner locked as resolved and limited conversation to collaborators Sep 23, 2019
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