Make unicode handling explicit, to support python 2 and 3.

Add link to Unidecode library in docs.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
This commit is contained in:
Graham R. Cobb 2021-03-16 16:29:57 +00:00
parent 4b9c9d0a5f
commit cad2c055c5
2 changed files with 6 additions and 3 deletions

View file

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

View file

@ -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 <https://pypi.org/project/Unidecode/>`__ library.
Thanks are due to Sean and to all the people who created the Python
version and the beets extensible query architecture.