+ # python2 version used to do this
+ # data = os.read(proc.stdout.fileno(), 1024)
+ # however this always returned bytes...
+ data = proc.stdout.read()
+ log('we have read {}'.format(data))
+ # data should be str and not bytes because we use
+ # universal_lines = True, but to be clean
+ # instead of saying data != ""
+ if not data:
+ log('closing stdout')