From dc021d5e05145c2e25bf0334032ff1c2054cf2ce Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Mon, 28 Feb 2022 18:46:27 +0100 Subject: extras: Use shutil.move instead of os.rename os.rename fails when moving files between devices or filesystems. Instead use shutil.move which uses os.rename or falls back to copying the files and removing the originals. --- beetsplug/extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beetsplug/extras.py b/beetsplug/extras.py index a8d02e0..e731b6e 100644 --- a/beetsplug/extras.py +++ b/beetsplug/extras.py @@ -11,7 +11,7 @@ class ExtrasPlugin(beets.plugins.BeetsPlugin): def on_item_moved(self, item, source, destination): for (sourcepath, destpath) in self.gather(source, destination): - os.rename(sourcepath, destpath) + shutil.move(sourcepath, destpath) def on_item_copied(self, item, source, destination): for (sourcepath, destpath) in self.gather(source, destination): -- cgit v1.2.3-2-gb3c3