]> granicus.if.org Git - python/commitdiff
#5741 followup: should also allow %%(blah)s.
authorGeorg Brandl <georg@python.org>
Mon, 13 Apr 2009 12:36:24 +0000 (12:36 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 13 Apr 2009 12:36:24 +0000 (12:36 +0000)
Lib/ConfigParser.py

index 2fa323b5206fec3cdc5f8452b487821e5be61a81..14bfdb690f256312a12d12bcff311b9436377381 100644 (file)
@@ -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: