playlists: Fix crash on urilist comment with non-ASCII chars
Fixes #1265
This commit is contained in:
parent
3e7e16097c
commit
78ffaeb8d2
@ -16,6 +16,10 @@ Bug fix release.
|
|||||||
to remove "file" from the :confval:`stream/protocols` config, and then
|
to remove "file" from the :confval:`stream/protocols` config, and then
|
||||||
proceed startup. (Fixes: :issue:`1248`, PR: :issue:`1254`)
|
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
|
- 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
|
path. This usually happens when running Mopidy as a system service, and thus
|
||||||
with a limited set of environment variables. (Fixes: :issue:`1249`, PR:
|
with a limited set of environment variables. (Fixes: :issue:`1249`, PR:
|
||||||
|
|||||||
@ -122,7 +122,7 @@ def parse_asx(data):
|
|||||||
def parse_urilist(data):
|
def parse_urilist(data):
|
||||||
result = []
|
result = []
|
||||||
for line in data.splitlines():
|
for line in data.splitlines():
|
||||||
if not line.strip() or line.startswith('#'):
|
if not line.strip() or line.startswith(b'#'):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
validation.check_uri(line)
|
validation.check_uri(line)
|
||||||
|
|||||||
@ -23,7 +23,7 @@ file:///tmp/baz
|
|||||||
|
|
||||||
URILIST = b"""
|
URILIST = b"""
|
||||||
file:///tmp/foo
|
file:///tmp/foo
|
||||||
# a comment
|
# a comment \xc5\xa7\xc5\x95
|
||||||
file:///tmp/bar
|
file:///tmp/bar
|
||||||
|
|
||||||
file:///tmp/baz
|
file:///tmp/baz
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user