tkem / mopidy-dleyna

Mopidy extension for playing music from Digital Media Servers
Apache License 2.0
18 stars 5 forks source link

Fix "AttributeError: module 'collections' has no attribute 'Mapping'" #74

Closed Fubukimaru closed 2 years ago

Fubukimaru commented 2 years ago

Mapping is no longer accesible through collections.Mapping. It was deprecated in python 3.8.

I have added the import as from collections.abc import Mapping, and then using directly Mapping in line 44 (now 46) of client.py class Servers(Mapping).

codecov-commenter commented 2 years ago

Codecov Report

Merging #74 (3820c76) into master (7fb628e) will increase coverage by 1.63%. The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
+ Coverage   45.27%   46.90%   +1.63%     
==========================================
  Files           6        7       +1     
  Lines         444      469      +25     
==========================================
+ Hits          201      220      +19     
- Misses        243      249       +6     
Impacted Files Coverage Δ
mopidy_dleyna/client.py 0.00% <0.00%> (ø)
mopidy_dleyna/__init__.py 76.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7fb628e...3820c76. Read the comment docs.

tkem commented 2 years ago

Thanks for bringing this up! Should have been fixed a long time ago... AFAIK, collections.Mapping was actually removed in Python 3.10. Since that's been out for quite a while now, I'll try and publish a new version of mopidy-dleyna ASAP.

Fubukimaru commented 2 years ago

Thanks for the fast response!

If I am not wrong, in python 3.8 they started throwing "Deprecated" warnings, but you are right. It was in Python 3.10 when it was removed.