From ac3ea16656d33e712616e491c0639f1d2053b3ad Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 27 Jan 2015 13:48:13 -0800 Subject: [PATCH] Fix for unicode_literals in scrub Here's an example where unicode_literals may not be a great idea: these should probably be "native" strings, i.e., bytes on 2.x and unicode on 3.x. --- beetsplug/scrub.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/beetsplug/scrub.py b/beetsplug/scrub.py index a832c9466..5c0d74e6e 100644 --- a/beetsplug/scrub.py +++ b/beetsplug/scrub.py @@ -26,21 +26,21 @@ from beets import config from beets import mediafile _MUTAGEN_FORMATS = { - 'asf': 'ASF', - 'apev2': 'APEv2File', - 'flac': 'FLAC', - 'id3': 'ID3FileType', - 'mp3': 'MP3', - 'mp4': 'MP4', - 'oggflac': 'OggFLAC', - 'oggspeex': 'OggSpeex', - 'oggtheora': 'OggTheora', - 'oggvorbis': 'OggVorbis', - 'oggopus': 'OggOpus', - 'trueaudio': 'TrueAudio', - 'wavpack': 'WavPack', - 'monkeysaudio': 'MonkeysAudio', - 'optimfrog': 'OptimFROG', + b'asf': b'ASF', + b'apev2': b'APEv2File', + b'flac': b'FLAC', + b'id3': b'ID3FileType', + b'mp3': b'MP3', + b'mp4': b'MP4', + b'oggflac': b'OggFLAC', + b'oggspeex': b'OggSpeex', + b'oggtheora': b'OggTheora', + b'oggvorbis': b'OggVorbis', + b'oggopus': b'OggOpus', + b'trueaudio': b'TrueAudio', + b'wavpack': b'WavPack', + b'monkeysaudio': b'MonkeysAudio', + b'optimfrog': b'OptimFROG', } @@ -103,7 +103,7 @@ class ScrubPlugin(BeetsPlugin): """ classes = [] for modname, clsname in _MUTAGEN_FORMATS.items(): - mod = __import__('mutagen.{0}'.format(modname), + mod = __import__(b'mutagen.{0}'.format(modname), fromlist=[clsname]) classes.append(getattr(mod, clsname)) return classes