diff --git a/test/test_lyrics.py b/test/test_lyrics.py index 7201de35a..9136131c1 100644 --- a/test/test_lyrics.py +++ b/test/test_lyrics.py @@ -27,7 +27,7 @@ from mock import MagicMock from test._common import unittest from beetsplug import lyrics from beets.library import Item -from beets.util import confit +from beets.util import confit, bytestring_path from beets import logging log = logging.getLogger('beets.test_lyrics') @@ -179,7 +179,9 @@ def url_to_filename(url): url = re.sub(r'https?://|www.', '', url) fn = "".join(x for x in url if (x.isalnum() or x == '/')) fn = fn.split('/') - fn = os.path.join(LYRICS_ROOT_DIR, fn[0], fn[-1]) + '.txt' + fn = os.path.join(LYRICS_ROOT_DIR, + bytestring_path(fn[0]), + bytestring_path(fn[-1] + '.txt')) return fn @@ -211,8 +213,8 @@ def is_lyrics_content_ok(title, text): keywords = LYRICS_TEXTS[google.slugify(title)] return all(x in text.lower() for x in keywords) -LYRICS_ROOT_DIR = os.path.join(_common.RSRC, 'lyrics') -LYRICS_TEXTS = confit.load_yaml(os.path.join(_common.RSRC, 'lyricstext.yaml')) +LYRICS_ROOT_DIR = os.path.join(_common.RSRC, b'lyrics') +LYRICS_TEXTS = confit.load_yaml(os.path.join(_common.RSRC, b'lyricstext.yaml')) DEFAULT_SONG = dict(artist=u'The Beatles', title=u'Lady Madonna') DEFAULT_SOURCES = [