Explorar el Código

Make sure that the root collection exists.

Since the collections are not directly in **filesystem_path** anymore,
the folder is not created by ``Collection.acquire_lock``.
Unrud hace 9 años
padre
commit
6c3e59fd11
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      radicale/storage.py

+ 4 - 0
radicale/storage.py

@@ -262,6 +262,8 @@ class BaseCollection:
 
         The ``path`` is relative.
 
+        The root collection "/" must always exist.
+
         """
         raise NotImplementedError
 
@@ -433,6 +435,8 @@ class Collection(BaseCollection):
 
         # Try to guess if the path leads to a collection or an item
         folder = cls._get_collection_root_folder()
+        # Create the root collection
+        cls._makedirs_synced(folder, exist_ok=True)
         try:
             filesystem_path = path_to_filesystem(folder, sane_path)
         except ValueError: