From 56602ec0ccae6037fd1d460ac2cf2862078e5c89 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 21 Jan 2014 20:02:50 -0800 Subject: [PATCH] expand justification for BytesQuery's existence --- beets/dbcore/query.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beets/dbcore/query.py b/beets/dbcore/query.py index 755e45301..27dd766cc 100644 --- a/beets/dbcore/query.py +++ b/beets/dbcore/query.py @@ -141,8 +141,9 @@ class BooleanQuery(MatchQuery): class BytesQuery(MatchQuery): """Match a raw bytes field (i.e., a path). This is a necessary hack - to distinguish between the common case, matching Unicode strings, - and the special case in which we match bytes. + to work around the `sqlite3` module's desire to treat `str` and + `unicode` equivalently in Python 2. Always use this query instead of + `MatchQuery` when matching on BLOB values. """ def __init__(self, field, pattern): super(BytesQuery, self).__init__(field, pattern)