Run case sensitivity check (#1586) on bytestring

This should avoid problems when querying for Unicode paths.
This commit is contained in:
Adrian Sampson 2015-10-07 16:38:27 -07:00
parent d29cc7b2c0
commit 3c8823db96

View file

@ -64,7 +64,8 @@ class PathQuery(dbcore.FieldQuery):
# By default, the case sensitivity depends on the filesystem
# that the query path is located on.
if case_sensitive is None:
case_sensitive = beets.util.case_sensitive(pattern)
path = util.bytestring_path(util.normpath(pattern))
case_sensitive = beets.util.case_sensitive(path)
self.case_sensitive = case_sensitive
# Use a normalized-case pattern for case-insensitive matches.