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.
This commit is contained in:
Adrian Sampson 2012-10-09 11:04:48 -07:00
parent 1662f34528
commit 4a0513ccd5

View file

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