Index: Lib/locale.py =================================================================== --- Lib/locale.py (Revision 74327) +++ Lib/locale.py (Arbeitskopie) @@ -207,8 +207,12 @@ """Formats a string in the same way that the % formatting would use, but takes the current locale into account. Grouping is applied if the third parameter is true.""" - percents = list(_percent_re.finditer(f)) - new_f = _percent_re.sub('%s', f) + # filter for %% + percents = [perc for perc in _percent_re.finditer(f) \ + if perc.group()[-1] != '%'] + new_f = f + for perc in percents[::-1]: + new_f = new_f[:perc.start()] + '%s' + new_f[perc.end():] if isinstance(val, tuple): new_val = list(val)