From 786bfb9168f7dc8ec32bae07f51cbdecea8de7b0 Mon Sep 17 00:00:00 2001 From: Fabrice Laporte Date: Thu, 25 Feb 2016 23:16:39 +0100 Subject: [PATCH 1/3] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 09981d1d7..f6c75ba61 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -23,7 +23,7 @@ Here's a link to the music files that trigger the bug (if relevant): * OS: * Python version: * beets version: -* I tried turning off plugins, and that made the problem go away (yes/no): +* Turning off plugins made problem go away (yes/no): My configuration (output of `beet config`) is: From 7202b3d4131f7436cebd3725605bfa89379c9271 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 26 Feb 2016 12:15:24 -0800 Subject: [PATCH 2/3] Slightly more logical instruction placement --- .github/ISSUE_TEMPLATE.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f6c75ba61..0f5481f0c 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,7 @@ -Describe your problem, feature request, or discussion topic here. If you're reporting a bug, please fill out the "Problem" and "Setup" sections below. Otherwise, you can delete it. - - ### Problem +(Describe your problem, feature request, or discussion topic here. If you're reporting a bug, please fill out this and the "Setup" section below. Otherwise, you can delete them.) + Running this command in verbose (`-vv`) mode: ```sh From a751d6d442935cfddd039ec742ea0239bb907c77 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 26 Feb 2016 12:23:32 -0800 Subject: [PATCH 3/3] Fix #1895: don't assume SC data is bytes --- beets/mediafile.py | 7 ++++++- docs/changelog.rst | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/beets/mediafile.py b/beets/mediafile.py index 5010f8797..02befcbb0 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -211,9 +211,14 @@ def _pack_asf_image(mime, data, type=3, description=""): # iTunes Sound Check encoding. def _sc_decode(soundcheck): - """Convert a Sound Check string value to a (gain, peak) tuple as + """Convert a Sound Check bytestring value to a (gain, peak) tuple as used by ReplayGain. """ + # We decode binary data. If one of the formats gives us a text + # string, guess that it's UTF-8. + if isinstance(soundcheck, unicode): + soundcheck = soundcheck.decode('utf8') + # SoundCheck tags consist of 10 numbers, each represented by 8 # characters of ASCII hex preceded by a space. try: diff --git a/docs/changelog.rst b/docs/changelog.rst index 3803894b2..349d484b9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,7 @@ Fixes: * Fix a problem with the :ref:`stats-cmd` in exact mode when filenames on Windows use non-ASCII characters. :bug:`1891` +* Fix a crash when iTunes Sound Check tags contained invalid data. :bug:`1895` 1.3.17 (February 7, 2016)