From 03731dd2d3aac0c9610c3b17d28f6821343fc8ed Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 13 Dec 2014 10:55:57 -0500 Subject: Port some of the commands. --- src/mailman/commands/cli_qfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mailman/commands/cli_qfile.py') diff --git a/src/mailman/commands/cli_qfile.py b/src/mailman/commands/cli_qfile.py index c4ff66aea..499476772 100644 --- a/src/mailman/commands/cli_qfile.py +++ b/src/mailman/commands/cli_qfile.py @@ -25,6 +25,8 @@ __all__ = [ ] +import six + from mailman.core.i18n import _ from mailman.interfaces.command import ICLISubCommand from mailman.utilities.interact import interact @@ -69,7 +71,7 @@ class QFile: """See `ICLISubCommand`.""" printer = PrettyPrinter(indent=4) assert len(args.qfile) == 1, 'Wrong number of positional arguments' - with open(args.qfile[0]) as fp: + with open(args.qfile[0], 'rb') as fp: while True: try: m.append(cPickle.load(fp)) @@ -80,7 +82,7 @@ class QFile: for i, obj in enumerate(m): count = i + 1 print(_('<----- start object $count ----->')) - if isinstance(obj, basestring): + if isinstance(obj, six.string_types): print(obj) else: printer.pprint(obj) -- cgit v1.2.3-70-g09d2