playlists: Fix crash on urilist comment with non-ASCII chars

Fixes #1265
This commit is contained in:
Stein Magnus Jodal 2015-08-22 23:51:07 +02:00
parent 3e7e16097c
commit 78ffaeb8d2
3 changed files with 6 additions and 2 deletions

View File

@ -16,6 +16,10 @@ Bug fix release.
to remove "file" from the :confval:`stream/protocols` config, and then
proceed startup. (Fixes: :issue:`1248`, PR: :issue:`1254`)
- Stream: Fix bug in new playlist parser. A non-ASCII char in an urilist
comment would cause a crash while parsing due to comparision of a non-ASCII
bytestring with a Unicode string. (Fixes: :issue:`1265`)
- File: Adjust log levels when failing to expand ``$XDG_MUSIC_DIR`` into a real
path. This usually happens when running Mopidy as a system service, and thus
with a limited set of environment variables. (Fixes: :issue:`1249`, PR:

View File

@ -122,7 +122,7 @@ def parse_asx(data):
def parse_urilist(data):
result = []
for line in data.splitlines():
if not line.strip() or line.startswith('#'):
if not line.strip() or line.startswith(b'#'):
continue
try:
validation.check_uri(line)

View File

@ -23,7 +23,7 @@ file:///tmp/baz
URILIST = b"""
file:///tmp/foo
# a comment
# a comment \xc5\xa7\xc5\x95
file:///tmp/bar
file:///tmp/baz