From eb07e9c44f2c34021141a35de28cb6aea4bcc425 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 17 Mar 2011 22:32:50 +0100 Subject: [PATCH] Fix mailman-rpc issue with non-ascii chars in comments. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- bin/lists.rpc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index e006547..33017d0 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -22,6 +22,8 @@ import base64, MySQLdb, os, getopt, sys, sha, signal, re, shutil, ConfigParser import MySQLdb.converters import SocketServer +import errno +import traceback sys.path.append('/usr/lib/mailman/bin') @@ -275,6 +277,7 @@ def list_call_locked(method, userdesc, perms, mlist, edit, *arg): mlist.Unlock() return ret except Exception, e: + traceback.print_exc(file=sys.stderr) sys.stderr.write('Exception in locked call %s: %s\n' % (method.__name__, str(e))) mlist.Unlock() return 0 @@ -568,6 +571,11 @@ def handle_request(userdesc, perms, mlist, id, value, comment): @edit @admin """ + # Force encoding to mailman's default for french, since this is what + # Mailman will use internally + # LC_DESCRIPTIONS is a dict of lang => (name, charset, direction) tuples. + encoding = mm_cfg.LC_DESCRIPTIONS['fr'][1] + comment = comment.encode(encoding) mlist.HandleRequest(int(id), int(value), comment) return 1 -- 2.1.4