From bbde63d87efe99b02128a56058c5946e60e5722c Mon Sep 17 00:00:00 2001 From: J0J0 Todos <2733783+JOJ0@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:29:25 +0200 Subject: [PATCH] lastgenre: Accept AI suggested use open() for tree file instead of codecs.open(), which most probably is a relict of beets' Python2/3 compatibility area. Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- beetsplug/lastgenre/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index f9a37d874..20a757a55 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -22,7 +22,6 @@ The scraper script used is available here: https://gist.github.com/1241307 """ -import codecs import os import traceback from typing import Union @@ -141,7 +140,7 @@ class LastGenrePlugin(plugins.BeetsPlugin): # Read the tree if c14n_filename: self._log.debug("Loading canonicalization tree {0}", c14n_filename) - with codecs.open( + with open( syspath(normpath(c14n_filename)), "r", encoding="utf-8" ) as f: genres_tree = yaml.safe_load(f)