In some environments, the read method on the pipe object fails to work, os.read should be the same, but seems to work better and is happy to perform the opportunisticly large reads I want.