From 99544fcf80a77d3952fe52f51150aa3b42103c81 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sun, 17 Apr 2016 13:58:56 +0900 Subject: [PATCH] Allow the creation of empty collections Fix #201 --- radicale/xmlutils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 81d6f28..974d338 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -128,8 +128,11 @@ def name_from_path(path, collection): def props_from_request(root, actions=("set", "remove")): """Return a list of properties as a dictionary.""" result = OrderedDict() - if not hasattr(root, "tag"): - root = ET.fromstring(root.encode("utf8")) + if root: + if not hasattr(root, "tag"): + root = ET.fromstring(root.encode("utf8")) + else: + return result for action in actions: action_element = root.find(_tag("D", action))