aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Archiver/HyperArch.py
diff options
context:
space:
mode:
authortkikuchi <>2005-05-13 11:35:38 +0000
committertkikuchi <>2005-05-13 11:35:38 +0000
commit3932f79538d5ba4ff30964086ef9bc129091f154 (patch)
tree9dd104173a7f679e57863b1e4d5d0164066de8c3 /Mailman/Archiver/HyperArch.py
parent264c89eee7d25b5ad439ef1f0304eb47ce9e7d84 (diff)
downloadmailman2-3932f79538d5ba4ff30964086ef9bc129091f154.tar.gz
mailman2-3932f79538d5ba4ff30964086ef9bc129091f154.tar.xz
mailman2-3932f79538d5ba4ff30964086ef9bc129091f154.zip
I finally find out why re.escape() doesn't work properly. '%' should not
be escaped for it is the insert directive. It was my trial and error in the comments in previous version. Well, I didn't think of '++' ...
Diffstat (limited to 'Mailman/Archiver/HyperArch.py')
-rw-r--r--Mailman/Archiver/HyperArch.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py
index c6a2ff0e..372f2409 100644
--- a/Mailman/Archiver/HyperArch.py
+++ b/Mailman/Archiver/HyperArch.py
@@ -410,9 +410,10 @@ class Article(pipermail.Article):
# This part was taken from CookHeaders.py (TK)
prefix = self._mlist.subject_prefix.strip()
if prefix:
- prefix_pat = re.sub(r'%\d*d', r'\s*\d+\s*', prefix)
- prefix_pat = re.sub('([\[\(\{\)])', '\\\\\g<1>', prefix_pat)
- subject = re.sub(re.escape(prefix_pat), '', subject)
+ prefix_pat = re.escape(prefix)
+ prefix_pat = '%'.join(prefix_pat.split(r'\%'))
+ prefix_pat = re.sub(r'%\d*d', r'\s*\d+\s*', prefix_pat)
+ subject = re.sub(prefix_pat, '', subject)
subject = subject.lstrip()
strip_pat = re.compile('^((RE|AW|SV)(\[\d+\])?:\s*)+', re.I)
stripped = strip_pat.sub('', subject)