diff --git a/Lib/configparser.py b/Lib/configparser.py index 3c452afe8ade485..f64c3bf525230d2 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -670,7 +670,27 @@ def __init__(self, defaults=None, dict_type=_default_dict, self._optcre = self.OPTCRE_NV if allow_no_value else self.OPTCRE else: d = "|".join(re.escape(d) for d in delimiters) - if allow_no_value: + if any(dl.strip() == "" for dl in delimiters): + if allow_no_value: + self._optcre = re.compile( + r""" + (?P