~ubuntu-branches/ubuntu/hardy/mailman/hardy-updates

« back to all changes in this revision

Viewing changes to Mailman/Commands/cmd_subscribe.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-07-03 16:59:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060703165925-175ubna955u796c0
Tags: 0:2.1.8-1ubuntu1
* Merge to Debian; remaining Ubuntu changes:
  - debian/mailman.init: Create /var/{run,lock}/mailman.
  - debian/control: exim4 -> postfix.
* debian/control: Dependency fix: apache -> apache2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2002 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 2002-2005 by the Free Software Foundation, Inc.
2
2
#
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
16
 
17
17
"""
18
18
    subscribe [password] [digest|nodigest] [address=<address>]
84
84
            res.results.append(_('No valid address found to subscribe'))
85
85
            return STOP
86
86
        # Watch for encoded names
87
 
        h = make_header(decode_header(realname))
88
 
        # BAW: in Python 2.2, use just unicode(h)
89
 
        realname = h.__unicode__()
 
87
        try:
 
88
            h = make_header(decode_header(realname))
 
89
            # BAW: in Python 2.2, use just unicode(h)
 
90
            realname = h.__unicode__()
 
91
        except UnicodeError:
 
92
            realname = u''
90
93
        # Coerce to byte string if uh contains only ascii
91
94
        try:
92
95
            realname = realname.encode('us-ascii')