Merge branch 'xorg/maint' into xorg/master
[platal.git] / bin / lists.rpc.py
index 43814aa..ff30e73 100755 (executable)
@@ -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')
 
@@ -274,6 +276,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
@@ -567,6 +570,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, 'replace')
     mlist.HandleRequest(int(id), int(value), comment)
     return 1