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

Import ABC from collections.abc for Python 3.10 compatibility #1562

Closed tirkarthi closed 8 months ago

sijis commented 2 years ago

@tirkarthi thanks for the PR. Were you seeing an error / warning on python 3.10? Also, do you if there are any backwards version issues merging this?

tirkarthi commented 2 years ago

I don't see an error in running the tests. I guess the code path is not tested as they seem to be not hit or probably mocked. In terms of compatibility the deprecation warning is from Python 3.4 and above so the patch is compatible with Python 3.4+ and I don't see any issues.

jonesnc commented 2 years ago

@tirkarthi Are you testing with the slack plugin (errbot[slack]) enabled? That's where I'm seeing this collections import error on Python 3.10:

Traceback (most recent call last):
   File "/usr/lib/python3.10/site-packages/errbot/backends/base.py", line 868, in serve_forever
     if self.serve_once():
   File "/usr/lib/python3.10/site-packages/errbot/backends/slack.py", line 427, in serve_once
     self.auth = self.api_call("auth.test", raise_errors=False)
   File "/usr/lib/python3.10/site-packages/errbot/backends/slack.py", line 378, in api_call
     if not isinstance(response, collections.Mapping):
 AttributeError: module 'collections' has no attribute 'Mapping'
sijis commented 8 months ago

Fix in more recent PR.