From 80c6ad3ee73bf41b597f81f72fb6675b586fadf4 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 17 Jun 2003 15:58:38 +0000 Subject: membership_options(): Email addresses must be us-ascii, but it's possible they got into the database as Unicode objects instead of string objects. So before processing the address for the membership management pages, encode them all to ascii (note that we're /not/ talking about the realnames). This will still crash if there are non-ascii characters in the email address, but as that is illegal, it should never happen . Closes SF # 755188. Back port candidate. --- Mailman/Cgi/admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 17b3919ff..949689c2b 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -794,7 +794,9 @@ def membership_options(mlist, subcat, cgidata, doc, form): # If there are more members than allowed by chunksize, then we split the # membership up alphabetically. Otherwise just display them all. chunksz = mlist.admin_member_chunksize - all = mlist.getMembers() + # The email addresses had /better/ be ASCII, but might be encoded in the + # database as Unicodes. + all = [_m.encode() for _m in mlist.getMembers()] all.sort(lambda x, y: cmp(x.lower(), y.lower())) # See if the query has a regular expression regexp = cgidata.getvalue('findmember', '').strip() -- cgit v1.3.1