diff options
| author | tkikuchi | 2005-08-28 05:31:27 +0000 |
|---|---|---|
| committer | tkikuchi | 2005-08-28 05:31:27 +0000 |
| commit | 067dc15b2432bb285ab5e4a3eac6f4dddd67ed19 (patch) | |
| tree | ceac72251ee33742bfff7626c99dde163d3da946 /Mailman/UserDesc.py | |
| parent | bc1dad4f90a26ade7c4dd6d2863de88856e8b4b6 (diff) | |
| download | mailman-067dc15b2432bb285ab5e4a3eac6f4dddd67ed19.tar.gz mailman-067dc15b2432bb285ab5e4a3eac6f4dddd67ed19.tar.zst mailman-067dc15b2432bb285ab5e4a3eac6f4dddd67ed19.zip | |
Diffstat (limited to 'Mailman/UserDesc.py')
| -rw-r--r-- | Mailman/UserDesc.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Mailman/UserDesc.py b/Mailman/UserDesc.py index 118cf4da3..ec7db748e 100644 --- a/Mailman/UserDesc.py +++ b/Mailman/UserDesc.py @@ -1,21 +1,26 @@ -# Copyright (C) 2001,2002 by the Free Software Foundation, Inc. +# Copyright (C) 2001-2004 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 # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software +# along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """User description class/structure, for ApprovedAddMember and friends.""" + +from types import UnicodeType + + + class UserDesc: def __init__(self, address=None, fullname=None, password=None, digest=None, lang=None): @@ -53,5 +58,10 @@ class UserDesc: elif digest == 1: digest = 'yes' language = getattr(self, 'language', 'n/a') + # Make sure fullname and password are encoded if they're strings + if isinstance(fullname, UnicodeType): + fullname = fullname.encode('ascii', 'replace') + if isinstance(password, UnicodeType): + password = password.encode('ascii', 'replace') return '<UserDesc %s (%s) [%s] [digest? %s] [%s]>' % ( address, fullname, password, digest, language) |
