From 48ddfc6ac1b6c6d12705470a94c3e846619e88a9 Mon Sep 17 00:00:00 2001 From: edel_gerardo Date: Thu, 24 Apr 2025 20:43:14 -0600 Subject: [PATCH 1/2] Revert #472 and re-address #471 --- caldav/davclient.py | 4 ++++ caldav/objects.py | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/caldav/davclient.py b/caldav/davclient.py index 4da3e6b1..baf9560b 100644 --- a/caldav/davclient.py +++ b/caldav/davclient.py @@ -220,6 +220,10 @@ def _parse_response(self, response) -> Tuple[str, List[_Element], Optional[Any]] self.validate_status(status) elif elem.tag == dav.Href.tag: assert not href + # Fix for https://github.com/python-caldav/caldav/issues/471 + # Confluence server quotes the user email twice. We unquote it manually. + if '%2540' in elem.text: + elem.text = elem.text.replace('%2540', '%40') href = unquote(elem.text) elif elem.tag == dav.PropStat.tag: propstats.append(elem) diff --git a/caldav/objects.py b/caldav/objects.py index e88725fd..ff4026ec 100755 --- a/caldav/objects.py +++ b/caldav/objects.py @@ -312,7 +312,6 @@ def get_properties( exchange_path = path[:-1] else: exchange_path = path + "/" - properties = {unquote(k): v for k, v in properties.items()} if path in properties: rc = properties[path] From ac92604d96720127204468b833132f0c621c740a Mon Sep 17 00:00:00 2001 From: edel_gerardo Date: Thu, 24 Apr 2025 21:03:12 -0600 Subject: [PATCH 2/2] Applied tox -e style --- caldav/davclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caldav/davclient.py b/caldav/davclient.py index baf9560b..445b3590 100644 --- a/caldav/davclient.py +++ b/caldav/davclient.py @@ -222,8 +222,8 @@ def _parse_response(self, response) -> Tuple[str, List[_Element], Optional[Any]] assert not href # Fix for https://github.com/python-caldav/caldav/issues/471 # Confluence server quotes the user email twice. We unquote it manually. - if '%2540' in elem.text: - elem.text = elem.text.replace('%2540', '%40') + if "%2540" in elem.text: + elem.text = elem.text.replace("%2540", "%40") href = unquote(elem.text) elif elem.tag == dav.PropStat.tag: propstats.append(elem)