From a907d629a2e74a7409cd2391ffe340515dc0dcfa Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 9 Oct 2012 10:40:47 -0700 Subject: [PATCH] fix error when regex-querying path & artpath --- beets/util/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index e311692a9..3afa9b491 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -469,10 +469,12 @@ def str2bool(value): def as_string(value): """Convert a value to a Unicode object for matching with a query. - None becomes the empty string. + None becomes the empty string. Bytestrings are silently decoded. """ if value is None: return u'' + elif isinstance(value, str): + return value.decode('utf8', 'ignore') else: return unicode(value)