From 5480ceeaf8b123b3532f67787ae62548708cf52f Mon Sep 17 00:00:00 2001 From: David Date: Fri, 7 Nov 2014 20:46:35 -0500 Subject: [PATCH] Encode to ascii,not utf8.Replace missing chars --- beetsplug/discogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index cea7a9b0c..aaf9442a2 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -149,7 +149,7 @@ 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. - query = re.sub(r'(?u)\W+', ' ', query).encode('utf8') + query = re.sub(r'(?u)\W+', ' ', query).encode('ascii', "replace") # Strip medium information from query, Things like "CD1" and "disk 1" # can also negate an otherwise positive result. query = re.sub(r'(?i)\b(CD|disc)\s*\d+', '', query)