Must mark strings as bytes when writing to an io.BytesIO