From c6c255e21655075c64a0d1357d9c42a789e7f4cd Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 22 Oct 2024 12:14:04 +0200 Subject: [PATCH] chore: use shutil.move instead of Path.rename to move to purgatory Otherwise it will fail if src and dest are not on the same FS. --- umap/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umap/models.py b/umap/models.py index 8f12ade7..27bc9aae 100644 --- a/umap/models.py +++ b/umap/models.py @@ -1,6 +1,7 @@ import json import operator import os +import shutil import time import uuid from pathlib import Path @@ -498,7 +499,7 @@ class DataLayer(NamedModel): src = Path(self.geojson.storage.location) / self.storage_root() for version in self.versions: name = version["name"] - (src / name).rename(dest / f"{self.map.pk}_{name}") + shutil.move(src / name, dest / f"{self.map.pk}_{name}") def upload_to(self): root = self.storage_root()