beetbox / pyacoustid

Python bindings for Chromaprint acoustic fingerprinting and the Acoustid Web service
MIT License
325 stars 66 forks source link

Not compatible with Python 3.7 anymore #83

Open cybersphinx opened 3 months ago

cybersphinx commented 3 months ago

Installing the new beets 2.0 and the current version of pyacoustid on a Linux system with Python 3.7, beet import fails with

** error loading plugin chroma:
Traceback (most recent call last):
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beets/plugins.py", line 269, in load_plugins
    namespace = __import__(modname, None, None)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/beetsplug/chroma.py", line 23, in <module>
    import acoustid
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/acoustid.py", line 32, in <module>
    import chromaprint
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/chromaprint.py", line 55, in <module>
    _libchromaprint = _load_library(name)
  File "/home/user/.local/pipx/venvs/beets2/lib/python3.7/site-packages/chromaprint.py", line 49, in _load_library
    return ctypes.CDLL(name, winmode=0)
TypeError: __init__() got an unexpected keyword argument 'winmode'

The winmode argument was added in Python 3.8, while beets still supports 3.7.

Trying things to get it to work on 3.7 again I circumvented _load_library completely (just add return None as the first line) and it still identifies files just fine. I'm not sure if _load_library is needed on some Linux systems or why it works here without, but it would be nice if 3.7 compatibility could be restored at least for Linux or the Readme updated for the new requirements.