From ba250a30751d5568ff1d690987d6c77e9eec60d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20de=20Giessen?= Date: Tue, 13 May 2025 13:12:42 +0200 Subject: [PATCH] use shutil.move instead of os.rename to move file This prevents a "OSError: [Errno 18] Invalid cross-device link" if the temporary file was created on different filesystem (such as a tmpfs mount). --- scripts/changeprefix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/changeprefix.py b/scripts/changeprefix.py index 381a4568..1ecc2e43 100755 --- a/scripts/changeprefix.py +++ b/scripts/changeprefix.py @@ -73,7 +73,7 @@ def changefile(from_prefix, to_prefix, from_path, to_path, *, shutil.copystat(from_path, to_path) if to_path_temp: - os.rename(to_path, from_path) + shutil.move(to_path, from_path) elif from_path != '-': os.remove(from_path)