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

Unsupported set_exception() in python >=3.8 #116

Open
dargor0 opened this issue Jun 17, 2022 · 0 comments
Open

Unsupported set_exception() in python >=3.8 #116

dargor0 opened this issue Jun 17, 2022 · 0 comments
Labels
amqtt-client bug Something isn't working good first issue Good for newcomers

Comments

@dargor0
Copy link

dargor0 commented Jun 17, 2022

Using amqtt version 0.10.0 , with python 3.8.10 , on unexpected disconnections, this message is reported:

Task exception was never retrieved
future: <Task finished name='Task-622' coro=<MQTTClient.handle_connection_close() done, defined at /usr/local/lib/python3.8/dist-packages/amqtt/client.py:504> exception=RuntimeError('Task does not support set_exception operation')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/amqtt/client.py", line 535, in handle_connection_close
    cancel_tasks()
  File "/usr/local/lib/python3.8/dist-packages/amqtt/client.py", line 510, in cancel_tasks
    task.set_exception(ClientException("Connection lost"))
RuntimeError: Task does not support set_exception operation

It seems Task objects don't inherit set_exception() (as explained here). A quick workaround is replace them with task.cancel().

@FlorianLudwig FlorianLudwig added bug Something isn't working good first issue Good for newcomers amqtt-client labels Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amqtt-client bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants