errbot icon indicating copy to clipboard operation
errbot copied to clipboard

Import ABC from collections.abc for Python 3.10 compatibility

Open tirkarthi opened this issue 3 years ago • 3 comments

tirkarthi avatar Mar 22 '22 10:03 tirkarthi

@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?

sijis avatar Mar 25 '22 00:03 sijis

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.

tirkarthi avatar Mar 25 '22 04:03 tirkarthi

@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'

jonesnc avatar Jun 21 '22 17:06 jonesnc

Fix in more recent PR.

sijis avatar Dec 31 '23 21:12 sijis