From cad2c055c5e1e595b76e013598fe454caa957bf2 Mon Sep 17 00:00:00 2001 From: "Graham R. Cobb" Date: Tue, 16 Mar 2021 16:29:57 +0000 Subject: [PATCH] Make unicode handling explicit, to support python 2 and 3. Add link to Unidecode library in docs. Signed-off-by: Graham R. Cobb --- beetsplug/bareasc.py | 6 ++++-- docs/plugins/bareasc.rst | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beetsplug/bareasc.py b/beetsplug/bareasc.py index 43d83005a..d17cc4ac1 100644 --- a/beetsplug/bareasc.py +++ b/beetsplug/bareasc.py @@ -78,7 +78,9 @@ class BareascPlugin(BeetsPlugin): # Copied from commands.py - list_items if album: for album in lib.albums(query): - print_(unidecode(format(album, fmt))) + bare = unidecode(six.ensure_text(format(album, fmt))) + print_(six.ensure_str(bare)) else: for item in lib.items(query): - print_(six.ensure_str(unidecode(format(item, fmt)))) + bare = unidecode(six.ensure_text(format(item, fmt))) + print_(six.ensure_str(bare)) diff --git a/docs/plugins/bareasc.rst b/docs/plugins/bareasc.rst index a22063805..0c8d6636c 100644 --- a/docs/plugins/bareasc.rst +++ b/docs/plugins/bareasc.rst @@ -63,6 +63,7 @@ file. The only available option is: Credits ------- -The hard work in this plugin is done in Sean Burke's Unidecode library. +The hard work in this plugin is done in Sean Burke's +`Unidecode `__ library. Thanks are due to Sean and to all the people who created the Python version and the beets extensible query architecture.