~barry/mailman/lp1423756

« back to all changes in this revision

Viewing changes to src/mailman/commands/cli_import.py

  • Committer: Barry Warsaw
  • Date: 2015-01-05 01:20:33 UTC
  • mfrom: (7264.4.66 py3)
  • Revision ID: barry@list.org-20150105012033-zdrw9c2odhpf22fz
Merge the Python 3 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Importing list data into Mailman 3."""
19
19
 
20
 
from __future__ import absolute_import, print_function, unicode_literals
21
 
 
22
 
__metaclass__ = type
23
20
__all__ = [
24
21
    'Import21',
25
22
    ]
26
23
 
27
24
 
28
25
import sys
29
 
import cPickle
30
 
 
31
 
from zope.component import getUtility
32
 
from zope.interface import implementer
33
26
 
34
27
from mailman.core.i18n import _
35
28
from mailman.database.transaction import transactional
36
29
from mailman.interfaces.command import ICLISubCommand
37
30
from mailman.interfaces.listmanager import IListManager
38
31
from mailman.utilities.importer import import_config_pck, Import21Error
 
32
from six.moves import cPickle
 
33
from zope.component import getUtility
 
34
from zope.interface import implementer
39
35
 
40
36
 
41
37
 
78
74
        assert len(args.pickle_file) == 1, (
79
75
            'Unexpected positional arguments: %s' % args.pickle_file)
80
76
        filename = args.pickle_file[0]
81
 
        with open(filename) as fp:
 
77
        with open(filename, 'rb') as fp:
82
78
            while True:
83
79
                try:
84
80
                    config_dict = cPickle.load(fp)