def make_error_body(self, code, msg): buf = StringIO() write_int(buf, code) write_string(buf, msg) return buf.getvalue()