Update of /cvsroot/mailman/mailman/Mailman/Queue
In directory sc8-pr-cvs1:/tmp/cvs-serv20310/Mailman/Queue
Modified Files:
Tag: Release_2_1-maint
CommandRunner.py
Log Message:
Results.__init__(): It's possible for the Header functions to raise a
HeaderParseError, so if that happens just ignore the Subject header for
command purposes.
Index: CommandRunner.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Queue/CommandRunner.py,v
retrieving revision 2.26.2.3
retrieving revision 2.26.2.4
diff -u -d -r2.26.2.3 -r2.26.2.4
--- CommandRunner.py 7 Apr 2003 22:51:16 -0000 2.26.2.3
+++ CommandRunner.py 1 Dec 2003 01:52:12 -0000 2.26.2.4
@@ -40,9 +40,10 @@
from Mailman import LockFile
from email.Header import decode_header, make_header, Header
+from email.Errors import HeaderParseError
+from email.Iterators import typed_subpart_iterator
from email.MIMEText import MIMEText
from email.MIMEMessage import MIMEMessage
-from email.Iterators import typed_subpart_iterator
NL = '\n'
@@ -72,9 +73,13 @@
# Extract the subject header and do RFC 2047 decoding. Note that
# Python 2.1's unicode() builtin doesn't call obj.__unicode__().
subj = msg.get('subject', '')
- subj = make_header(decode_header(subj)).__unicode__()
- # Always process the Subject: header first
- self.commands.append(subj)
+ try:
+ subj = make_header(decode_header(subj)).__unicode__()
+ # Always process the Subject: header first
+ self.commands.append(subj)
+ except HeaderParseError:
+ # We couldn't parse it so ignore the Subject header
+ pass
# Find the first text/plain part
part = None
for part in typed_subpart_iterator(msg, 'text', 'plain'):
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org