Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion labelu/internal/common/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from abc import ABC, abstractmethod
from functools import lru_cache
import shutil
from pathlib import Path
from typing import Optional

Expand Down Expand Up @@ -60,7 +61,7 @@ def _resolve(self, key: str) -> Path:
def save_file(self, local_path: Path, key: str, content_type: Optional[str] = None) -> None:
target_path = self._resolve(key)
target_path.parent.mkdir(parents=True, exist_ok=True)
local_path.replace(target_path)
shutil.move(str(local_path), str(target_path))

def save_bytes(self, content: bytes, key: str, content_type: Optional[str] = None) -> None:
target_path = self._resolve(key)
Expand Down