From d9378753acda90d6b08aebcc2e08cc6e654ab580 Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Sun, 8 May 2005 12:32:27 +0000 Subject: Fix UnicodeDecodeError and UnicodeEncodeError to UnicodeError. Both are introduced in Python2.3. UnicodeError catches both. --- Mailman/Commands/cmd_subscribe.py | 2 +- Mailman/Handlers/Decorate.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mailman/Commands/cmd_subscribe.py b/Mailman/Commands/cmd_subscribe.py index 2b3304b4..5dac09ad 100644 --- a/Mailman/Commands/cmd_subscribe.py +++ b/Mailman/Commands/cmd_subscribe.py @@ -88,7 +88,7 @@ def process(res, args): h = make_header(decode_header(realname)) # BAW: in Python 2.2, use just unicode(h) realname = h.__unicode__() - except UnicodeDecodeError: + except UnicodeError: realname = u'' # Coerce to byte string if uh contains only ascii try: diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py index 433629c6..1b756192 100644 --- a/Mailman/Handlers/Decorate.py +++ b/Mailman/Handlers/Decorate.py @@ -56,7 +56,7 @@ def process(mlist, msg, msgdata): username = mlist.getMemberName(member) or None try: username = username.encode(Utils.GetCharSet(d['user_language'])) - except (AttributeError, UnicodeEncodeError): + except (AttributeError, UnicodeError): username = member d['user_name'] = username d['user_optionsurl'] = mlist.GetOptionsURL(member) -- cgit v1.2.3