From: Georg Brandl Date: Mon, 13 Apr 2009 12:36:24 +0000 (+0000) Subject: #5741 followup: should also allow %%(blah)s. X-Git-Tag: v2.7a1~1479 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73709e62ff97c822aa644eec4104c21e530815c5;p=python #5741 followup: should also allow %%(blah)s. --- diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py index 2fa323b520..14bfdb690f 100644 --- a/Lib/ConfigParser.py +++ b/Lib/ConfigParser.py @@ -665,8 +665,8 @@ class SafeConfigParser(ConfigParser): raise TypeError("option values must be strings") # check for bad percent signs: # first, replace all "good" interpolations - tmp_value = self._interpvar_re.sub('', value) - tmp_value = tmp_value.replace('%%', '') + tmp_value = value.replace('%%', '') + tmp_value = self._interpvar_re.sub('', tmp_value) # then, check if there's a lone percent sign left percent_index = tmp_value.find('%') if percent_index != -1: