diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index d4928af2b..878004976 100644 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -375,10 +375,6 @@ class Model(object): value = unicode(value) if for_path: - replacements = self._db.replacements or [] - for regex, repl in replacements: - value = regex.sub(repl, value) - sep_repl = beets.config['path_sep_replace'].get(unicode) for sep in (os.path.sep, os.path.altsep): if sep: diff --git a/docs/changelog.rst b/docs/changelog.rst index 529e0a2cf..0bff69eb5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -75,8 +75,6 @@ Other little fixes: are now treated as directories. Thanks to Pedro Silva. * The :ref:`modify-cmd` command now skips confirmation and prints a message if no changes are necessary. Thanks to brilnius. -* The replacement characters for path separators can be set in the - "replace" configuration. * :doc:`/plugins/fetchart`: When using the ``remote_priority`` config option, local image files are no longer completely ignored. * :doc:`/plugins/echonest`: Fix an issue causing the plugin to appear twice in diff --git a/test/_common.py b/test/_common.py index 540397cce..00640f5bc 100644 --- a/test/_common.py +++ b/test/_common.py @@ -257,18 +257,14 @@ class Bag(object): def platform_windows(): import ntpath old_path = os.path - try: - os.path = ntpath - yield - finally: - os.path = old_path + os.path = ntpath + yield + os.path = old_path @contextmanager def platform_posix(): import posixpath old_path = os.path - try: - os.path = posixpath - yield - finally: - os.path = old_path + os.path = posixpath + yield + os.path = old_path diff --git a/test/test_library.py b/test/test_library.py index ac6ffbe37..8eabb4122 100644 --- a/test/test_library.py +++ b/test/test_library.py @@ -248,21 +248,6 @@ class DestinationTest(_common.TestCase): self.assertFalse('>' in p) self.assertFalse('|' in p) - def test_replace_unix_path_separator_from_config(self): - self.i.title = 'one \\ two / three.mp3' - self.lib.replacements = [(re.compile(r'[\\/]'), 'x')] - with _common.platform_windows(): - p = self.i.destination() - self.assertTrue('one x two x three.mp3' in p) - self.lib.replacements = None - - def test_replace_windows_path_separator_from_config(self): - self.i.title = 'one \\ two / three.mp3' - self.lib.replacements = [(re.compile(r'[\\/]'), 'x')] - with _common.platform_windows(): - p = self.i.destination() - self.assertTrue('one x two x three.mp3' in p) - def test_path_with_format(self): self.lib.path_formats = [('default', '$artist/$album ($format)')] p = self.i.destination()