errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.12k stars 612 forks source link

type BinaryIO declaration missing #1573

Closed futex closed 2 years ago

futex commented 2 years ago

I got this error when i start errbot 6.1.9

10:49:26 INFO errbot.bootstrap Found Storage plugin: Shelf. 10:49:26 INFO errbot.bootstrap Found Backend plugin: Telegram 10:49:26 DEBUG errbot.storage Opening storage 'repomgr' 10:49:26 DEBUG errbot.storage.shelf Open shelf storage /bot/errbot-ve/data/repomgr.db 10:49:26 ERROR errbot.bootstrap Unable to load or configure the backend. Traceback (most recent call last): File "/bot//python3.8/site-packages/errbot/bootstrap.py", line 181, in setup_bot bot = backendpm.load_plugin() File "/bot//python3.8/site-packages/errbot/backend_plugin_manager.py", line 62, in load_plugin plugin_classes = self.plugin_info.load_plugin_classes( File "/bot//python3.8/site-packages/errbot/plugin_info.py", line 100, in load_plugin_classes spec.loader.exec_module(modu1e) File "<frozen importlib._bootstrap_external>", line 848, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/bot//python3.8/site-packages/errbot/backends/telegram_messenger.py", line 189, in <module> class TelegramBackend(ErrBot): File "/bot//python3.8/site-packages/errbot/backends/telegram_messenger.py", line 418, in TelegramBackend fsource: Union[str, dict, BinaryIO], NameError: name 'BinaryIO' is not define

In the file errbot/backends/telegram_messenger.py it seem a declaration is missing I have replace the line

from typing import Any, Optional, Union by from typing import Any, Optional, Union, BinaryIO, List, Optional

And now it's worked

nzlosh commented 2 years ago

Can you create a PR with this fix please?

sijis commented 2 years ago

Fixed via https://github.com/errbotio/errbot/pull/1574