~abompard/mailman/import21

« back to all changes in this revision

Viewing changes to src/mailman/utilities/importer.py

  • Committer: Aurélien Bompard
  • Date: 2013-10-03 15:14:57 UTC
  • Revision ID: aurelien@bompard.org-20131003151457-e9nkqa6otibq2s6b
Strings are almost always bytestrings in the pickle, test for that

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        mlist.archive_policy = ArchivePolicy.never
198
198
    # Handle ban list
199
199
    for addr in config_dict.get('ban_list', []):
200
 
        IBanManager(mlist).ban(addr)
 
200
        IBanManager(mlist).ban(unicode(addr))
201
201
    # Handle acceptable aliases
202
202
    for addr in config_dict.get('acceptable_aliases', '').splitlines():
203
203
        addr = addr.strip()
204
204
        if not addr:
205
205
            continue
206
 
        IAcceptableAliasSet(mlist).add(addr)
 
206
        IAcceptableAliasSet(mlist).add(unicode(addr))
207
207
    # Handle conversion to URIs
208
208
    convert_to_uri = {
209
209
        "welcome_msg": "welcome_message_uri",
299
299
                original_email = merged_members[email]
300
300
            else:
301
301
                original_email = email
302
 
            user = usermanager.create_user(original_email)
 
302
            user = usermanager.create_user(unicode(original_email))
303
303
        address = usermanager.get_address(email)
304
304
        address.verified_on = datetime.datetime.now()
305
305
        mlist.subscribe(address, role)