From 4a0513ccd5e85bfa337d9346784a0611898cf703 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 9 Oct 2012 11:04:48 -0700 Subject: [PATCH] actually fix unicode-path-query exception I mistakenly assumed that the value sent to _regexp from SQLite would be a str object. It's a buffer object, of course. This change explicitly converts to a str before doing the decoding. --- beets/util/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beets/util/__init__.py b/beets/util/__init__.py index 3afa9b491..313313cf2 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -473,6 +473,8 @@ def as_string(value): """ if value is None: return u'' + elif isinstance(value, buffer): + return str(value).decode('utf8', 'ignore') elif isinstance(value, str): return value.decode('utf8', 'ignore') else: