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>
This commit is contained in:
J0J0 Todos 2025-09-01 07:29:25 +02:00 committed by J0J0 Todos
parent a98fa054fe
commit bbde63d87e

View file

@ -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)