From 9e27d4e2a8719033d6e1bde865ad0bc99c92d8b0 Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 2 Sep 2016 15:06:32 +0200 Subject: [PATCH] Emulate fullmatch with match re.fullmatch was introduced in Python 3.4 --- radicale/rights.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radicale/rights.py b/radicale/rights.py index bad50a96..00928435 100644 --- a/radicale/rights.py +++ b/radicale/rights.py @@ -134,10 +134,12 @@ class Rights(BaseRights): self.logger.debug( "Test if '%s:%s' matches against '%s:%s' from section '%s'", user, sane_path, re_user, re_collection, section) - user_match = re.fullmatch(re_user, user) + # Emulate fullmatch + user_match = re.match(r"(?:%s)\Z" % re_user, user) if user_match: re_collection = re_collection.format(*user_match.groups()) - if re.fullmatch(re_collection, sane_path): + # Emulate fullmatch + if re.match(r"(?:%s)\Z" % re_collection, sane_path): self.logger.debug("Section '%s' matches", section) return permission in regex.get(section, "permission") else: