From 150dd0c4cd662da53a01e0d0ae742fec20286472 Mon Sep 17 00:00:00 2001 From: Unrud Date: Tue, 19 May 2020 07:03:58 +0200 Subject: [PATCH] Trim all (ASCII) whitespace characters --- radicale/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radicale/config.py b/radicale/config.py index 8ac0526..d30e677 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -28,6 +28,7 @@ Use ``load()`` to obtain an instance of ``Configuration`` for use with import contextlib import math import os +import string from collections import OrderedDict from configparser import RawConfigParser @@ -75,7 +76,7 @@ def list_of_ip_address(value): def ip_address(value): try: address, port = value.rsplit(":", 1) - return address.strip("[] "), int(port) + return address.strip(string.whitespace + "[]"), int(port) except ValueError: raise ValueError("malformed IP address: %r" % value) return [ip_address(s) for s in value.split(",")]