Update of /cvsroot/mailman/mailman/Mailman
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22638
Modified Files:
Tag: Release_2_1-maint
Message.py
Log Message:
Brushing up the override function.
Index: Message.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Message.py,v
retrieving revision 2.25.2.2
retrieving revision 2.25.2.3
diff -u -d -r2.25.2.2 -r2.25.2.3
--- Message.py 21 Apr 2005 04:30:36 -0000 2.25.2.2
+++ Message.py 22 Apr 2005 00:34:11 -0000 2.25.2.3
@@ -190,12 +190,21 @@
def get_content_charset(self, failobj=None):
"""email.Message.Message.get_content_charset() should return failobj
- on error.
+ on error. Also, check if the returned charset is supported by the
+ current running mailman instance.
"""
+ # First, trap known error in super class get_content_charset().
+ # This check will not needed if email package is updated.
try:
- return email.Message.Message.get_content_charset(self, failobj)
- except:
- return failobj
+ charset = email.Message.Message.get_content_charset(self, failobj)
+ except (LookupError, UnicodeError, ValueError):
+ return failobj
+ # Check if charset is supported.
+ try:
+ unicode('x', charset)
+ except (LookupError, ValueError):
+ return failobj
+ return charset
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org