bitbot-irc / bitbot

https://bitbot.dev | Python3 event-driven modular IRCv3 bot 🤖

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bot doesn't run on python 3.9

lilmike opened this issue · comments

Hi,
When trying to run the bot on arch linux, using python 3.9, I get the following output:

May 27 10:02:46 lpublic bitbotd[2388648]: 2021-05-27T10:02:46.392 [ERROR] Failed to load module "rss": module 'base64' has no attribute 'decodestring' May 27 10:02:46 lpublic bitbotd[2388648]: Traceback (most recent call last): May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/bitbot/bitbotd", line 137, in May 27 10:02:46 lpublic bitbotd[2388648]: bot.load_modules() May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/bitbot/src/IRCBot.py", line 166, in load_modules May 27 10:02:46 lpublic bitbotd[2388648]: return self.modules.load_modules(self, whitelist=whitelist, May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/bitbot/src/ModuleManager.py", line 359, in load_modules May 27 10:02:46 lpublic bitbotd[2388648]: self.load_module(bot, definition) May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/bitbot/src/ModuleManager.py", line 285, in load_module May 27 10:02:46 lpublic bitbotd[2388648]: loaded_module = self._load_module(bot, definition, May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/bitbot/src/ModuleManager.py", line 239, in _load_module May 27 10:02:46 lpublic bitbotd[2388648]: loader.exec_module(module) May 27 10:02:46 lpublic bitbotd[2388648]: File "", line 855, in exec_module May 27 10:02:46 lpublic bitbotd[2388648]: File "", line 228, in _call_with_frames_removed May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/bitbot/modules/rss.py", line 6, in May 27 10:02:46 lpublic bitbotd[2388648]: import feedparser May 27 10:02:46 lpublic bitbotd[2388648]: File "/storage/bitbot/.local/lib/python3.9/site-packages/feedparser.py", line 93, in May 27 10:02:46 lpublic bitbotd[2388648]: _base64decode = getattr(base64, 'decodebytes', base64.decodestring) May 27 10:02:46 lpublic bitbotd[2388648]: AttributeError: module 'base64' has no attribute 'decodestring'

-Michael.

This is due to a change in the way base64 works on python 3.9. If we can find a way to fix this without breaking compatibility with older versions of python then I think we'll be good.

Should be resolved now