Skip to content

'AioReactor' object has no attribute 'scheduler' #208

@asdf8dfafjk

Description

@asdf8dfafjk

Hello, I'm using this package via github.com/zulip/zulip 's irc<->zulip bridge, and am coming across the following error. The zulip integration uses the async reactor but @rht 's research says

irc/irc/bot.py

Line 107 in 4c15d34

self.bot.reactor.scheduler.execute_after(intvl, self.check)
incorrectly assumes a sync reactor and that the scheduler attribute referred to in the said code doesn't exist for the async reactor.

Could you suggest a fix here?

Full error message:

Exception in callback _SelectorSocketTransport._call_connection_lost(ReadTimeout(R...meout=15.0)")))
handle: <Handle _SelectorSocketTransport._call_connection_lost(ReadTimeout(R...meout=15.0)")))>
Traceback (most recent call last):
  File "/nix/store/r85cm22i6058g4zj76w05rzvqwil6d2g-python3-3.11.1/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/nix/store/r85cm22i6058g4zj76w05rzvqwil6d2g-python3-3.11.1/lib/python3.11/asyncio/selector_events.py", line 1117, in _call_connection_lost
    super()._call_connection_lost(exc)
  File "/nix/store/r85cm22i6058g4zj76w05rzvqwil6d2g-python3-3.11.1/lib/python3.11/asyncio/selector_events.py", line 875, in _call_connection_lost
    self._protocol.connection_lost(exc)
  File "/home/zx/zulip/python-zulip-api/zulip-api-py3-venv/lib/python3.11/site-packages/irc/client_aio.py", line 82, in connection_lost
    self.connection.disconnect()
  File "/home/zx/zulip/python-zulip-api/zulip-api-py3-venv/lib/python3.11/site-packages/irc/client_aio.py", line 214, in disconnect
    self._handle_event(Event("disconnect", self.server, "", [message]))
  File "/home/zx/zulip/python-zulip-api/zulip-api-py3-venv/lib/python3.11/site-packages/irc/client.py", line 376, in _handle_event
    self.reactor._handle_event(self, event)
  File "/home/zx/zulip/python-zulip-api/zulip-api-py3-venv/lib/python3.11/site-packages/irc/client.py", line 922, in _handle_event
    result = handler.callback(connection, event)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zx/zulip/python-zulip-api/zulip-api-py3-venv/lib/python3.11/site-packages/irc/bot.py", line 202, in _on_disconnect
    self.recon.run(self)
  File "/home/zx/zulip/python-zulip-api/zulip-api-py3-venv/lib/python3.11/site-packages/irc/bot.py", line 107, in run
    self.bot.reactor.scheduler.execute_after(intvl, self.check)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AioReactor' object has no attribute 'scheduler'


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions