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.9 Breaks HBMQTT: 'Lock' object is not iterable #223

Open
ekkizogloy opened this issue Nov 11, 2020 · 1 comment
Open

Python 3.9 Breaks HBMQTT: 'Lock' object is not iterable #223

ekkizogloy opened this issue Nov 11, 2020 · 1 comment

Comments

@ekkizogloy
Copy link

ekkizogloy commented Nov 11, 2020

Python 3.9 changes the way that locks are used. This breaks HBMQTT.
It looks like this change is what causes it:
python/cpython@90d9ba6

Error:

Unhandled exception: 'Lock' object is not iterable
Connection failed: TypeError("'Lock' object is not iterable")

Code to recreate the issue:

import asyncio
from hbmqtt.client import MQTTClient, ClientException
from hbmqtt.mqtt.constants import QOS_1

remote_url = "mqtt://test.mosquitto.org:1883/"
topic = "testtopic/testtest"
msgdata = b'Hello'

async def main():
    b = MQTTClient(config={'keep_alive': 60})
    await b.connect(remote_url)
    while True:
        await asyncio.sleep(5)
        asyncio.create_task(b.publish(topic=topic, message=msgdata, qos=QOS_1))

if __name__ == '__main__':
    asyncio.run(main())
@HerrMuellerluedenscheid

This is addressed in #226

HerrMuellerluedenscheid referenced this issue Jan 12, 2021
… conditions on detached sessions, eliminated set_exception on client disconnect tasks, a few debug log message isEnabledFor wrappers.
dotlambda added a commit to dotlambda/nixpkgs that referenced this issue Jan 22, 2021
jonringer pushed a commit to NixOS/nixpkgs that referenced this issue Jan 22, 2021
niobos added a commit to niobos/velbuspy that referenced this issue Oct 30, 2021
hbmqtt is not compatible with Python3.9 [1] and doesn't look like this
is going to be fixed soon.

[1]: njouanin/hbmqtt#223
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