Explorar o código

Don't crash if propsfile doesn't exist

Markus Unterwaditzer %!s(int64=10) %!d(string=hai) anos
pai
achega
a1cdcf2fba
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      radicale/storage.py

+ 1 - 1
radicale/storage.py

@@ -349,7 +349,7 @@ class Collection:
             with open(props_path, encoding=STORAGE_ENCODING) as prop_file:
                 properties.update(json.load(prop_file))
         properties[key] = value
-        with open(props_path, "w", encoding=STORAGE_ENCODING) as prop_file:
+        with open(props_path, "w+", encoding=STORAGE_ENCODING) as prop_file:
             json.dump(properties, prop_file)
 
     @property