diff options
author | Wolfgang Müller | 2022-02-28 18:46:27 +0100 |
---|---|---|
committer | Wolfgang Müller | 2022-02-28 18:46:27 +0100 |
commit | dc021d5e05145c2e25bf0334032ff1c2054cf2ce (patch) | |
tree | 942d85d5d77e19fe5106b362e6268be09442c10a /beetsplug | |
parent | e94b6ed8e4cc925c2051c133fa3b5d3b2b2971a2 (diff) | |
download | beets-oriole-dc021d5e05145c2e25bf0334032ff1c2054cf2ce.tar.gz |
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.
Diffstat (limited to 'beetsplug')
-rw-r--r-- | beetsplug/extras.py | 2 |
1 files changed, 1 insertions, 1 deletions
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): |