jdev - 2023-01-15


  1. VesselWave

    Hello, I am trying to write an XMPP OMEMO chat bot in Python. The only example, that I found is this: https://lab.louiz.org/poezio/slixmpp-omemo/-/blob/main/examples/echo_client.py . It is done with slixmpp and slixmpp-omemo. Unfortunetly, it does not work. The error I get: RuntimeError: no running event loop sys:1: RuntimeWarning: coroutine 'XEP_0384.session_start_omemo' was never awaited Could you please help me?

  2. pep.

    We've started to see stuff like that in slix recently. It's weird because this call specifically is done the following say: `asyncio.create_task(self.session_start_omemo())`.

  3. pep.

    Also that's a warning, that shouldn't stop the bot from running, does it

  4. pep.

    Also that's a warning, that shouldn't stop the bot from running, does it stop really?

  5. VesselWave

    It stops: Traceback (most recent call last): File "/home/user/Documents/Projects/echo_client.py", line 329, in <module> xmpp.register_plugin( File "/home/user/.local/lib/python3.10/site-packages/slixmpp/basexmpp.py", line 269, in register_plugin self.plugin.enable(plugin, pconfig) # type: ignore File "/home/user/.local/lib/python3.10/site-packages/slixmpp/plugins/base.py", line 162, in enable plugin._init() File "/home/user/.local/lib/python3.10/site-packages/slixmpp/plugins/base.py", line 318, in _init self.plugin_init() File "/home/user/.local/lib/python3.10/site-packages/slixmpp_omemo/__init__.py", line 239, in plugin_init asyncio.create_task(self.session_start_omemo()) File "/usr/lib/python3.10/asyncio/tasks.py", line 336, in create_task loop = events.get_running_loop() RuntimeError: no running event loop sys:1: RuntimeWarning: coroutine 'XEP_0384.session_start_omemo' was never awaited

  6. pep.

    Ok that helps having the actual error not just a warning that's a side-effect of it

  7. VesselWave

    I've made a rollback via `pip install slixmpp-omemo==0.8.0` the error disappeared

  8. VesselWave

    https://lab.louiz.org/poezio/slixmpp-omemo/-/compare/v0.8.0...v0.9.0

  9. pep.

    I guess that's related to 02b3380ac345370fa615534bab167e8ead2c9aa9 "Replace ensure_future calls with create_task", but I'm not sure why the loop isn't created

  10. pep.

    I'll have a look, thanks