diff options
author | Thomi Richards <thomi.richards@canonical.com> | 2013-11-25 18:22:30 +1300 |
---|---|---|
committer | Thomi Richards <thomi.richards@canonical.com> | 2013-11-25 18:22:30 +1300 |
commit | f9ab16ac7c0627069285e6046ce6f885f347238b (patch) | |
tree | c629c4f2d3f3040fb057a61dcaad7877764a0e9c /python/subunit/_output.py | |
parent | 1f597852ccc82d60591b17bf076225e54a8e84c2 (diff) | |
download | subunit-git-f9ab16ac7c0627069285e6046ce6f885f347238b.tar.gz |
Open files in binary mode.
Diffstat (limited to 'python/subunit/_output.py')
-rw-r--r-- | python/subunit/_output.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/subunit/_output.py b/python/subunit/_output.py index 32d5110..8be2ca8 100644 --- a/python/subunit/_output.py +++ b/python/subunit/_output.py @@ -134,7 +134,7 @@ def parse_arguments(args=None, ParserClass=OptionParser): options.attach_file = sys.stdin else: try: - options.attach_file = open(options.attach_file) + options.attach_file = open(options.attach_file, 'rb') except IOError as e: parser.error("Cannot open %s (%s)" % (options.attach_file, e.strerror)) if options.tags and not options.action: @@ -166,8 +166,8 @@ def generate_stream_results(args, output_writer): if args.attach_file: reader = partial(args.attach_file.read, _CHUNK_SIZE) - this_file_hunk = reader().encode('utf8') - next_file_hunk = reader().encode('utf8') + this_file_hunk = reader() + next_file_hunk = reader() is_first_packet = True is_last_packet = False @@ -202,7 +202,7 @@ def generate_stream_results(args, output_writer): is_last_packet = True else: this_file_hunk = next_file_hunk - next_file_hunk = reader().encode('utf8') + next_file_hunk = reader() else: is_last_packet = True |