From 5ff88b46cf9e428dfc56f01817501516ba6d2f9c Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Sun, 31 Aug 2025 19:24:45 +0200 Subject: [PATCH] lastgenre: Fix another mypy error in c14n load (that was only happening in CI and not by local poe check-types) --- beetsplug/lastgenre/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index aa627ca3d..be329e8b5 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -140,9 +140,10 @@ class LastGenrePlugin(plugins.BeetsPlugin): c14n_filename = C14N_TREE # Read the tree if c14n_filename: - self._log.debug("Loading canonicalization tree {}", c14n_filename) - c14n_filename = normpath(c14n_filename) - with codecs.open(c14n_filename, "r", encoding="utf-8") as f: + self._log.debug("Loading canonicalization tree {0}", c14n_filename) + with codecs.open( + str(normpath(c14n_filename)), "r", encoding="utf-8" + ) as f: genres_tree = yaml.safe_load(f) flatten_tree(genres_tree, [], c14n_branches) return c14n_branches, canonicalize