Describe the bug
When running the latest release 6.1.9 from docker with the XMPP backend, errbot fails to start, giving the following error:
2022-06-18 15:05:34,523 ERROR errbot.bootstrap Unable to load or configure the backend.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/errbot/bootstrap.py", line 181, in setup_bot
bot = backendpm.load_plugin()
File "/usr/local/lib/python3.9/site-packages/errbot/backend_plugin_manager.py", line 62, in load_plugin
plugin_classes = self.plugin_info.load_plugin_classes(
File "/usr/local/lib/python3.9/site-packages/errbot/plugin_info.py", line 100, in load_plugin_classes
spec.loader.exec_module(modu1e)
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/local/lib/python3.9/site-packages/errbot/backends/xmpp.py", line 123, in <module>
class XMPPRoom(XMPPIdentifier, Room):
File "/usr/local/lib/python3.9/site-packages/errbot/backends/xmpp.py", line 252, in XMPPRoom
def occupants(self) -> List[XMPPRoomOccupant]:
NameError: name 'XMPPRoomOccupant' is not defined
This also happens with a docker image built manually from latest master.
The problem is that the type annotation of the XMPPRoom.occupants function references the XMPPRoomOccupant class which is not yet defined at that point.
To Reproduce
Run errbotio/errbot:6.1.9 with a config that has backend XMPP.
Expected behavior
I would expect this to not fail. Indeed, adding a line from __future__ import annotations to the top of errbot/backends/xmpp.py solves the problem.
Environment (please complete the following information):
Describe the bug When running the latest release
6.1.9
from docker with the XMPP backend, errbot fails to start, giving the following error:This also happens with a docker image built manually from latest master.
The problem is that the type annotation of the
XMPPRoom.occupants
function references theXMPPRoomOccupant
class which is not yet defined at that point.To Reproduce Run
errbotio/errbot:6.1.9
with a config that has backendXMPP
.Expected behavior I would expect this to not fail. Indeed, adding a line
from __future__ import annotations
to the top oferrbot/backends/xmpp.py
solves the problem.Environment (please complete the following information):
6.1.9