simplebot-org / simplebot

Extensible Delta Chat bot written in Python3
Mozilla Public License 2.0
34 stars 9 forks source link

Crashes on init (AttributeError: 'str' object has no attribute '__code__') #103

Closed snan closed 2 years ago

snan commented 2 years ago
Traceback (most recent call last):
  File "/usr/local/bin/simplebot", line 33, in <module>
    sys.exit(load_entry_point('simplebot', 'console_scripts', 'simplebot')())
  File "/home/sandra/py/simplebot/src/simplebot/main.py", line 22, in main
    bot = make_bot_from_args(args, plugin_manager=pm)
  File "/home/sandra/py/simplebot/src/simplebot/main.py", line 37, in make_bot_from_args
    return DeltaBot(account, logger, plugin_manager=plugin_manager, args=args)
  File "/home/sandra/py/simplebot/src/simplebot/bot.py", line 185, in __init__
    plugin_manager.hook.deltabot_init.call_historic(
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_hooks.py", line 277, in call_historic
    res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.9/dist-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/home/sandra/py/simplebot_xmpp/simplebot_xmpp/__init__.py", line 33, in deltabot_init
    bot.commands.register("/xmpp_bridge", cmd_bridge)
  File "/home/sandra/py/simplebot/src/simplebot/commands.py", line 39, in register
    short, long, args = parse_command_docstring(
  File "/home/sandra/py/simplebot/src/simplebot/commands.py", line 162, in parse_command_docstring
    funcargs = set(inspect.getargs(func.__code__).args)
AttributeError: 'str' object has no attribute '__code__'

This is after pip installing the git repo versions (as opposed to the releases package) of simplebot and simplebot_xmpp, and then this happens on simplebot init address password

adbenitez commented 2 years ago

hi @snan, the issue is that the simplebot_xmpp plugin is REALLY outdated and incomplete, so it is incompatible with current versions of simplebot, please don't use it, sorry for the troubles

snan commented 2 years ago

Which plugins are current?

adbenitez commented 2 years ago

anyone that doesn't say the contrary, in this case it was my bad, I forgot to say so in the repo, also you can check if the CI is passing/green (badge in the README) or check the requirements file to see what version of simplebot was used by the plugin creator