My last commits broke functionality for Python2, but it's relatively
simple to fix.
open() becomes io.open() -- it effectively does nothing for Python3,
but for Python2 it uses a backported version of the open() call.
Python2 uses bytes and strings interchangably, but I needed to use
stdout.sys.buffer for writing arbitrary bytes data to stdout.
Conditionally call the appropriate stream depending on Python version.
When encountering non-ASCII UTF-8 characters in source files (as
exists in Crispy Doom), the Python scripts would fail to work with
a UnicodeDecodeError if the locale was not a UTF-8 one (eg, the C
locale as encountered in chroot build environments).
Let's just use UTF-8 on both open() and replace print() statements with
sys.stdout.buffer.write(). This guarantees that all input and output is
UTF-8 regardless.