From: Thomi Richards Date: Mon, 25 Nov 2013 05:32:29 +0000 (+1300) Subject: Read binary from stdin. X-Git-Url: http://git.samba.org/samba.git/?p=third_party%2Fsubunit;a=commitdiff_plain;h=075c9e5d7e7a1fb96e19da7295238c08504ddb93 Read binary from stdin. --- diff --git a/python/subunit/_output.py b/python/subunit/_output.py index 8be2ca8..0a1ef5d 100644 --- a/python/subunit/_output.py +++ b/python/subunit/_output.py @@ -131,7 +131,10 @@ def parse_arguments(args=None, ParserClass=OptionParser): if options.attach_file == '-': if not options.file_name: options.file_name = 'stdin' - options.attach_file = sys.stdin + if sys.version[0] >= '3': + options.attach_file = sys.stdin.buffer + else: + options.attach_file = sys.stdin else: try: options.attach_file = open(options.attach_file, 'rb')