diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 09981d1d7..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 @@ -23,7 +22,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: 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 77be3019a..4e3b12893 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -14,6 +14,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)