Skip to content

Commit

Permalink
chore: use shutil.move instead of Path.rename to move to purgatory (#…
Browse files Browse the repository at this point in the history
…2236)

Otherwise it will fail if src and dest are not on the same FS.
  • Loading branch information
yohanboniface authored Oct 24, 2024
2 parents 928ce82 + c6c255e commit 023f48e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion umap/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import operator
import os
import shutil
import time
import uuid
from pathlib import Path
Expand Down Expand Up @@ -498,7 +499,7 @@ def to_purgatory(self):
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()
Expand Down

0 comments on commit 023f48e

Please sign in to comment.