diff options
| author | bwarsaw | 2002-12-02 14:41:29 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-12-02 14:41:29 +0000 |
| commit | f85f0a25daabcd33b6b881bf91e92913ca85da93 (patch) | |
| tree | eca27d72e32d4c233b6b0ab3c20d9e5ead6d9c8b | |
| parent | b9db54ab6a659ca7e229e3fdab57aa38d563fc9a (diff) | |
| download | mailman-f85f0a25daabcd33b6b881bf91e92913ca85da93.tar.gz mailman-f85f0a25daabcd33b6b881bf91e92913ca85da93.tar.zst mailman-f85f0a25daabcd33b6b881bf91e92913ca85da93.zip | |
main(): This should fix problems when printing list members with
"funny" characters in their names. We coerce the output to the
default encoding, although I'm not 100% sure this is the right thing
to do. (Works for me.)
| -rwxr-xr-x | bin/list_members | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/list_members b/bin/list_members index b5b91ac29..3ad10f516 100755 --- a/bin/list_members +++ b/bin/list_members @@ -6,14 +6,14 @@ # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. """List all the members of a mailing list. @@ -203,7 +203,9 @@ def main(): # Filter out nomails if nomail and not whymatches(mlist, addr, why): continue - print >> fp, formataddr((name, addr)) + enc = sys.getdefaultencoding() + s = formataddr((name, addr)).encode(enc, 'replace') + print >> fp, s if digest: dmembers.sort() for addr in dmembers: @@ -220,8 +222,11 @@ def main(): # They're getting MIME digests if kind == 'plain': continue - print >> fp, formataddr((name, addr)) + enc = sys.getdefaultencoding() + s = formataddr((name, addr)).encode(enc, 'replace') + print >> fp, s + if __name__ == '__main__': main() |
