From 9dd0d69317e7144abbc410078a4d67b5701cef43 Mon Sep 17 00:00:00 2001 From: bwarsaw <> Date: Fri, 13 May 2005 02:34:39 +0000 Subject: strip_subject() in HyperArch.py prefix_subject() in CookHeaders.py When calling re.sub() to substitute the subject prefix, you have to escape the pattern, otherwise prefixes like [C++] cause "multiple repeat" exceptions in re. Also, whitespace normalization and copyright years updates. --- Mailman/Archiver/HyperArch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Mailman/Archiver/HyperArch.py') diff --git a/Mailman/Archiver/HyperArch.py b/Mailman/Archiver/HyperArch.py index 5a37adad..c6a2ff0e 100644 --- a/Mailman/Archiver/HyperArch.py +++ b/Mailman/Archiver/HyperArch.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2005 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -412,7 +412,7 @@ class Article(pipermail.Article): 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(prefix_pat, '', subject) + subject = re.sub(re.escape(prefix_pat), '', subject) subject = subject.lstrip() strip_pat = re.compile('^((RE|AW|SV)(\[\d+\])?:\s*)+', re.I) stripped = strip_pat.sub('', subject) @@ -585,7 +585,7 @@ class Article(pipermail.Article): try: del self.html_body except AttributeError: - pass + pass class HyperArchive(pipermail.T): -- cgit v1.2.3