From 58da871d4528df26b13c8aa576559313f0da5abe Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 17 Nov 2019 21:07:16 -0800 Subject: [PATCH] Migrate from `os.rename` to `shutil.move` `os.rename` is brittle and prone to failure. Among other things, it struggles with moving files between mount points. Something that's required if you have docker volumes. Should also address https://github.com/dbr/tvnamer/issues/154 --- tvnamer/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tvnamer/utils.py b/tvnamer/utils.py index 173fa99..5954a2c 100644 --- a/tvnamer/utils.py +++ b/tvnamer/utils.py @@ -1006,7 +1006,7 @@ def delete_file(fpath): def rename_file(old, new): p("rename %s to %s" % (old, new)) stat = os.stat(old) - os.rename(old, new) + shutil.move(old, new) try: os.utime(new, (stat.st_atime, stat.st_mtime)) except OSError as ex: