mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 01:25:47 +01:00
use codecs module to decode to hex in _sc_decode
'hex' doesn't exist as a decoder for bytes in py3
This commit is contained in:
parent
7ab0964826
commit
42d642f1f6
1 changed files with 2 additions and 1 deletions
|
|
@ -45,6 +45,7 @@ import mutagen.flac
|
|||
import mutagen.monkeysaudio
|
||||
import mutagen.asf
|
||||
import mutagen.aiff
|
||||
import codecs
|
||||
import datetime
|
||||
import re
|
||||
import base64
|
||||
|
|
@ -222,7 +223,7 @@ def _sc_decode(soundcheck):
|
|||
# SoundCheck tags consist of 10 numbers, each represented by 8
|
||||
# characters of ASCII hex preceded by a space.
|
||||
try:
|
||||
soundcheck = soundcheck.replace(b' ', b'').decode('hex')
|
||||
soundcheck = codecs.decode(soundcheck.replace(b' ', b''), 'hex')
|
||||
soundcheck = struct.unpack('!iiiiiiiiii', soundcheck)
|
||||
except (struct.error, TypeError):
|
||||
# SoundCheck isn't in the format we expect, so return default
|
||||
|
|
|
|||
Loading…
Reference in a new issue