]> granicus.if.org Git - python/commitdiff
Merged revisions 71564 via svnmerge from
authorGeorg Brandl <georg@python.org>
Mon, 27 Apr 2009 16:43:36 +0000 (16:43 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 27 Apr 2009 16:43:36 +0000 (16:43 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71564 | georg.brandl | 2009-04-13 14:36:24 +0200 (Mo, 13 Apr 2009) | 1 line

  #5741 followup: should also allow %%(blah)s.
........

Lib/configparser.py

index 4fc9a8d4e492dfee3b7b6de82c3f32e959d535a8..bfbe4cbe4eed1bdb5298c06ac8b809637e6b4e5b 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: