Use stdout.buffer to output raw string in Python 3; refs #29