diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index e64da8d5c..2e8109fb9 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -376,7 +376,7 @@ def _parse_id(s): no ID can be found, return None. """ # Find the first thing that looks like a UUID/MBID. - match = re.search(ur'[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}', s) + match = re.search(u'[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}', s) if match: return match.group() diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py index c58a1db9b..a1e573361 100644 --- a/beetsplug/replaygain.py +++ b/beetsplug/replaygain.py @@ -222,9 +222,9 @@ class Bs1770gainBackend(Backend): out = [] data = text.decode('utf8', errors='ignore') regex = re.compile( - ur'(\s{2,2}\[\d+\/\d+\].*?|\[ALBUM\].*?)' - '(?=\s{2,2}\[\d+\/\d+\]|\s{2,2}\[ALBUM\]' - ':|done\.\s)', re.DOTALL | re.UNICODE) + u'(\\s{2,2}\\[\\d+\\/\\d+\\].*?|\\[ALBUM\\].*?)' + '(?=\\s{2,2}\\[\\d+\\/\\d+\\]|\\s{2,2}\\[ALBUM\\]' + ':|done\\.\\s)', re.DOTALL | re.UNICODE) results = re.findall(regex, data) for parts in results[0:num_lines]: part = parts.split(b'\n') diff --git a/test/test_ui.py b/test/test_ui.py index 0ca4f7115..e52e7eba9 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -760,7 +760,7 @@ class ConfigTest(unittest.TestCase, TestHelper, _common.Assertions): ui._raw_main(['test']) replacements = self.test_cmd.lib.replacements - self.assertEqual(replacements, [(re.compile(ur'[xy]'), 'z')]) + self.assertEqual(replacements, [(re.compile(u'[xy]'), 'z')]) def test_multiple_replacements_parsed(self): with self.write_config_file() as config: @@ -769,8 +769,8 @@ class ConfigTest(unittest.TestCase, TestHelper, _common.Assertions): ui._raw_main(['test']) replacements = self.test_cmd.lib.replacements self.assertEqual(replacements, [ - (re.compile(ur'[xy]'), u'z'), - (re.compile(ur'foo'), u'bar'), + (re.compile(u'[xy]'), u'z'), + (re.compile(u'foo'), u'bar'), ]) def test_cli_config_option(self):