From 1e7a4247c69923c31a92d2ab6c0d0ffc8cd8970b Mon Sep 17 00:00:00 2001 From: kingosticks Date: Sun, 4 Jan 2015 20:21:10 +0000 Subject: [PATCH 1/3] Add non-ascii utf-8 chars to test playlists --- tests/audio/test_playlists.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/audio/test_playlists.py b/tests/audio/test_playlists.py index eb79cfeb..f01568f8 100644 --- a/tests/audio/test_playlists.py +++ b/tests/audio/test_playlists.py @@ -13,7 +13,7 @@ BAD = b'foobarbaz' M3U = b"""#EXTM3U #EXTINF:123, Sample artist - Sample title file:///tmp/foo -#EXTINF:321,Example Artist - Example title +#EXTINF:321,Example Artist - Example \xc5\xa7\xc5\x95 file:///tmp/bar #EXTINF:213,Some Artist - Other title file:///tmp/baz @@ -25,7 +25,7 @@ File1=file:///tmp/foo Title1=Sample Title Length1=123 File2=file:///tmp/bar -Title2=Example title +Title2=Example \xc5\xa7\xc5\x95 Length2=321 File3=file:///tmp/baz Title3=Other title @@ -40,7 +40,7 @@ ASX = b""" - Example title + Example \xc5\xa7\xc5\x95 @@ -65,7 +65,7 @@ XSPF = b""" file:///tmp/foo - Example title + Example \xc5\xa7\xc5\x95 file:///tmp/bar From d666083c6fe8fe17a5880b6e8e55890cf51992c4 Mon Sep 17 00:00:00 2001 From: kingosticks Date: Sun, 4 Jan 2015 20:26:45 +0000 Subject: [PATCH 2/3] Use bytestrings when parsing M3U playlists Fixes #853 --- mopidy/audio/playlists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mopidy/audio/playlists.py b/mopidy/audio/playlists.py index 5688db4b..5a362191 100644 --- a/mopidy/audio/playlists.py +++ b/mopidy/audio/playlists.py @@ -58,11 +58,11 @@ def parse_m3u(data): # TODO: convert non URIs to file URIs. found_header = False for line in data.readlines(): - if found_header or line.startswith('#EXTM3U'): + if found_header or line.startswith(b'#EXTM3U'): found_header = True else: continue - if not line.startswith('#') and line.strip(): + if not line.startswith(b'#') and line.strip(): yield line.strip() From e252dd3a555679cbf49e77ee03c1df7599dabc38 Mon Sep 17 00:00:00 2001 From: kingosticks Date: Sun, 4 Jan 2015 20:54:13 +0000 Subject: [PATCH 3/3] Update changelog --- docs/changelog.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index a4d5ee44..8cfb9cdf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -93,6 +93,14 @@ v0.20.0 (UNRELEASED) - Add basic tests for the stream library provider. +v0.19.6 (UNRELEASED) +==================== + +**Audio** + +- Support UTF-8 in M3U playlists. (Fixes: :issue:`853`) + + v0.19.5 (2014-12-23) ====================