flipcoder / textbeat

🎹 plaintext music sequencer and midi shell, with vim playback and the powers of music theory 🥁
MIT License
406 stars 13 forks source link

AttributeError: module 'collections' has no attribute 'Mapping' #8

Closed hejops closed 2 years ago

hejops commented 2 years ago

Calling textbeat with no arguments produced the following traceback. A quick glance at the collections API suggests that the attribute is under collections.abc.Mapping; could this be the cause?

Traceback (most recent call last):
  File "/usr/bin/textbeat", line 33, in <module>
    sys.exit(load_entry_point('textbeat==0.1.0', 'console_scripts', 'textbeat')())
  File "/usr/bin/textbeat", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 162, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/textbeat-0.1.0-py3.10.egg/textbeat/__main__.py", line 52, in <module>
    from .defs import *
  File "/usr/lib/python3.10/site-packages/textbeat-0.1.0-py3.10.egg/textbeat/defs.py", line 197, in <module>
    merge(DEFS,load_def(f[:-len(DEF_EXT)]))
  File "/usr/lib/python3.10/site-packages/textbeat-0.1.0-py3.10.egg/textbeat/defs.py", line 163, in merge
    if contains and isinstance(a[k], dict) and isinstance(b[k], collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'
flipcoder commented 2 years ago

Ah yes that would explain the issue. It must have been moved. Thanks, I will get a proper fix for that.

flipcoder commented 2 years ago

I just pushed the fix to both master and develop branch now, so let me know if it's working for you. Thanks for the help.

https://github.com/flipcoder/textbeat/commit/6e62245c7fba43544034ddde548aff19bf4e722e

hejops commented 2 years ago

Works great, thanks for the quick response!