diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/sync_members | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/sync_members b/bin/sync_members index 58262841..0c860d25 100755 --- a/bin/sync_members +++ b/bin/sync_members @@ -257,7 +257,9 @@ def main(): if not dryrun: mlist.ApprovedAddMember(userdesc, welcome, notifyadmin) # Avoid UnicodeError if name can't be decoded - name = unicode(name, errors='replace').encode(enc, 'replace') + if isinstance(name, str): + name = unicode(name, errors='replace') + name = name.encode(enc, 'replace') s = email.Utils.formataddr((name, addr)).encode(enc, 'replace') print _('Added : %(s)s') except Errors.MMAlreadyAMember: @@ -279,7 +281,9 @@ def main(): # get rid of this member's entry mlist.removeMember(addr) # Avoid UnicodeError if name can't be decoded - name = unicode(name, errors='replace').encode(enc, 'replace') + if isinstance(name, str): + name = unicode(name, errors='replace') + name = name.encode(enc, 'replace') s = email.Utils.formataddr((name, addr)).encode(enc, 'replace') print _('Removed: %(s)s') |