From be12a89372b96c1502733a4d1ade45e1deecd5f9 Mon Sep 17 00:00:00 2001 From: Alexei Datskevich <4024096+translit@users.noreply.github.com> Date: Sat, 30 Mar 2019 08:34:13 +0100 Subject: [PATCH 1/2] Fix PyYAML yaml.load(input) Deprecation --- beetsplug/lastgenre/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index 2f660206e..c3a4332bd 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -152,7 +152,7 @@ class LastGenrePlugin(plugins.BeetsPlugin): self._log.debug('Loading canonicalization tree {0}', c14n_filename) c14n_filename = normpath(c14n_filename) with codecs.open(c14n_filename, 'r', encoding='utf-8') as f: - genres_tree = yaml.load(f) + genres_tree = yaml.safe_load(f) flatten_tree(genres_tree, [], self.c14n_branches) @property From 97c3590aecd868ddbc0250f8c0530f3159d8a19d Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 30 Mar 2019 13:11:13 -0400 Subject: [PATCH 2/2] Changelog for #3192 --- docs/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 1fcc691a5..afd2e23b2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -160,6 +160,9 @@ Fixes: :bug:`2826` :bug:`3092` * :doc:`/plugins/beatport`: Avoid a crash when the server produces an error. :bug:`3184` +* :doc:`/plugins/lastgenre`: Avoid a deprecation warning from the YAML + library. + :bug:`3192` .. _python-itunes: https://github.com/ocelma/python-itunes