diff --git a/beetsplug/absubmit.py b/beetsplug/absubmit.py index 3d21c469c..0c288b9d8 100644 --- a/beetsplug/absubmit.py +++ b/beetsplug/absubmit.py @@ -133,8 +133,8 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin): item=item, error=e ) return None - with open(filename) as tmp_file: - analysis = json.loads(tmp_file.read()) + with open(filename, 'rb') as tmp_file: + analysis = json.load(tmp_file) # Add the hash to the output. analysis['metadata']['version']['essentia_build_sha'] = \ self.extractor_sha diff --git a/docs/changelog.rst b/docs/changelog.rst index 2e4f1be54..413cf0df0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -35,6 +35,8 @@ Fixes: music. :bug:`2667` * :doc:`/plugins/chroma`: Fix a crash when running the ``submit`` command on Python 3 on Windows with non-ASCII filenames. :bug:`2671` +* :doc:`/plugins/absubmit`: Fix an occasional crash on Python 3 when the AB + analysis tool produced non-ASCII metadata. :bug:`2673` For developers: