[Pkg-mailman-hackers] Pkg-mailman commit - rev 208 - in trunk/debian: . patches

Tollef Fog Heen tfheen@costa.debian.org
Wed, 16 Feb 2005 21:16:08 +0100


Author: tfheen
Date: 2005-02-16 21:16:08 +0100 (Wed, 16 Feb 2005)
New Revision: 208

Added:
   trunk/debian/patches/handle-from-in-non-ascii.dpatch
Modified:
   trunk/debian/changelog
Log:
handle non-ascii from lines (closes: 293861)

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2005-02-16 19:33:22 UTC (rev 207)
+++ trunk/debian/changelog	2005-02-16 20:16:08 UTC (rev 208)
@@ -2,6 +2,7 @@
 
   * Brown bag release -- use '/' instead of the undefined SLASH in
     Cgi/private.py.  (closes: #294874)
+  * Handle the case of non-ascii chars in realname.  (closes: #293861)
 
  -- Tollef Fog Heen <tfheen@debian.org>  Wed, 16 Feb 2005 20:29:00 +0100
 

Added: trunk/debian/patches/handle-from-in-non-ascii.dpatch
===================================================================
--- trunk/debian/patches/handle-from-in-non-ascii.dpatch	2005-02-16 19:33:22 UTC (rev 207)
+++ trunk/debian/patches/handle-from-in-non-ascii.dpatch	2005-02-16 20:16:08 UTC (rev 208)
@@ -0,0 +1,34 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## handle-from-in-non-ascii.dpatch by  <tfheen@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad trunk/Mailman/Commands/cmd_subscribe.py /tmp/dpep.glnNSg/trunk/Mailman/Commands/cmd_subscribe.py
+--- trunk/Mailman/Commands/cmd_subscribe.py	2002-11-21 06:37:25.000000000 +0100
++++ /tmp/dpep.glnNSg/trunk/Mailman/Commands/cmd_subscribe.py	2005-02-16 21:10:35.179365720 +0100
+@@ -76,6 +76,7 @@
+     if password is None:
+         password = Utils.MakeRandomPassword()
+     if address is None:
++        h = None
+         realname, address = parseaddr(res.msg['from'])
+         if not address:
+             # Fall back to the sender address
+@@ -84,9 +85,13 @@
+             res.results.append(_('No valid address found to subscribe'))
+             return STOP
+         # Watch for encoded names
+-        h = make_header(decode_header(realname))
++        try:
++            h = make_header(decode_header(realname))
++        except UnicodeDecodeError:
++            # Just fall back to an empty real, it's not critical
++            h = ""
+         # BAW: in Python 2.2, use just unicode(h)
+-        realname = h.__unicode__()
++        realname = unicode(h)
+         # Coerce to byte string if uh contains only ascii
+         try:
+             realname = realname.encode('us-ascii')


Property changes on: trunk/debian/patches/handle-from-in-non-ascii.dpatch
___________________________________________________________________
Name: svn:executable
   + *