From 6dc1f6414d2e229ad0502b69e7655361d3f51115 Mon Sep 17 00:00:00 2001 From: Nick Sellen Date: Wed, 17 Mar 2021 09:06:35 +0000 Subject: [PATCH] Remove ascii encoding step now library is fixed --- beetsplug/discogs.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 05abb80c2..d52973b6f 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -239,13 +239,10 @@ class DiscogsPlugin(BeetsPlugin): # cause a query to return no results, even if they match the artist or # album title. Use `re.UNICODE` flag to avoid stripping non-english # word characters. - # FIXME: Encode as ASCII to work around a bug: - # https://github.com/beetbox/beets/issues/1051 - # When the library is fixed, we should encode as UTF-8. - query = re.sub(r'(?u)\W+', ' ', query).encode('ascii', "replace") + query = re.sub(r'(?u)\W+', ' ', query) # Strip medium information from query, Things like "CD1" and "disk 1" # can also negate an otherwise positive result. - query = re.sub(br'(?i)\b(CD|disc)\s*\d+', b'', query) + query = re.sub(r'(?i)\b(CD|disc)\s*\d+', '', query) self.request_start() try: