From f169f2f19b7c2c45c7a9d513ad2d6feaa0bff248 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 13 Apr 2016 22:08:57 +0200 Subject: [PATCH] Don't crash if collection doesn't exist yet --- radicale/storage.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radicale/storage.py b/radicale/storage.py index 157920c..410ce95 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -227,7 +227,12 @@ class Collection: def list(self): """List collection items.""" - for href in os.listdir(self._filesystem_path): + try: + hrefs = os.listdir(self._filesystem_path) + except IOError: + return + + for href in hrefs: path = os.path.join(self._filesystem_path, href) if not href.endswith(".props") and os.path.isfile(path): with open(path, encoding=STORAGE_ENCODING) as fd: