From a1cdcf2fba4956de6d83d7a7012ae92e5bfed96b Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Tue, 12 Apr 2016 22:43:10 +0200 Subject: [PATCH] Don't crash if propsfile doesn't exist --- radicale/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicale/storage.py b/radicale/storage.py index 5a63434..157920c 100644 --- a/radicale/storage.py +++ b/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