Deprecated import of collections.MutableMapping in pwd.py
Created originally on Bitbucket by Anonymous
I’m using passlib 1.7.1 on Python 3.7. In the passlib.pwd
module, MutableMapping
is imported from collections
, which is the right module in Python 2. In Python 3, it should be imported from collections.abc
instead. According to a deprecation warning I received, the backwards compatibility code provides the ABCs at their old location will be removed in Python 3.8, which would break passlib.
To reproduce:
$ python -Wd
Python 3.7.2 (default, Feb 26 2019, 13:02:33)
[GCC 7.3.1 20180323 [gcc-7-branch revision 258812]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import passlib.pwd
/home/mth/.cache/pypoetry/virtualenvs/softfab-py3.7/lib/python3.7/site-packages/passlib/pwd.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import defaultdict, MutableMapping
>>>