From da8127cd5ed1133fa5a49b0758f0105bebc894e6 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 29 Oct 2002 21:50:40 +0000 Subject: to_dollar(): We have to not only escape $'s but we have to unescape double %'s. to_percent(): Vice versa. --- Mailman/Utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 024adf745..3226a154f 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -664,7 +664,7 @@ def midnight(date=None): def to_dollar(s): """Convert from %-strings to $-strings.""" - s = s.replace('$', '$$') + s = s.replace('$', '$$').replace('%%', '%') parts = cre.split(s) for i in range(1, len(parts), 2): if parts[i+1] and parts[i+1][0] in IDENTCHARS: @@ -676,7 +676,7 @@ def to_dollar(s): def to_percent(s): """Convert from $-strings to %-strings.""" - s = s.replace('%', '%%') + s = s.replace('%', '%%').replace('$$', '$') parts = dre.split(s) for i in range(1, len(parts), 4): if parts[i] is not None: -- cgit v1.3.1