From 7149380ff9a4f77f523b4b82e88b22c4e55a77a6 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 2 Mar 2017 18:29:52 +0200 Subject: Fallback to reading one-byte-at-a-time on Windows (#22) select.select does not work on file descriptors on Windows, causing subunit to fail. --- python/subunit/v2.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python') diff --git a/python/subunit/v2.py b/python/subunit/v2.py index 9ff139c..254617c 100644 --- a/python/subunit/v2.py +++ b/python/subunit/v2.py @@ -309,6 +309,11 @@ class ByteStreamToStreamResult(object): # annoying). buffered = [content] while len(buffered[-1]): + # Note: Windows does not support passing a file descriptor to + # select.select. fallback to one-byte-at-a-time. + if sys.platform == 'win32': + break + try: self.source.fileno() except: -- cgit v1.2.1