Read binary from stdin.
authorThomi Richards <thomi.richards@canonical.com>
Mon, 25 Nov 2013 05:32:29 +0000 (18:32 +1300)
committerThomi Richards <thomi.richards@canonical.com>
Mon, 25 Nov 2013 05:32:29 +0000 (18:32 +1300)
python/subunit/_output.py

index 8be2ca88b2b1ad2ca21a6996e26b0602b02d632f..0a1ef5dcaf454099f83d3b8f17a5cc48a359df45 100644 (file)
@@ -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')