mirror of
https://github.com/beetbox/beets.git
synced 2026-01-02 05:52:50 +01:00
catch codecs hex encoding errors too (from binascii)
binascii is used internally by codecs, and I didn't initially know that
This commit is contained in:
parent
0385937647
commit
7df59d5e30
1 changed files with 2 additions and 1 deletions
|
|
@ -49,6 +49,7 @@ import codecs
|
|||
import datetime
|
||||
import re
|
||||
import base64
|
||||
import binascii
|
||||
import math
|
||||
import struct
|
||||
import imghdr
|
||||
|
|
@ -225,7 +226,7 @@ def _sc_decode(soundcheck):
|
|||
try:
|
||||
soundcheck = codecs.decode(soundcheck.replace(b' ', b''), 'hex')
|
||||
soundcheck = struct.unpack('!iiiiiiiiii', soundcheck)
|
||||
except (struct.error, TypeError):
|
||||
except (struct.error, TypeError, binascii.Error):
|
||||
# SoundCheck isn't in the format we expect, so return default
|
||||
# values.
|
||||
return 0.0, 0.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue