--- xen-4.12.0/tools/pygrub/src/pygrub.orig 2019-04-01 21:25:33.206405995 +0100 +++ xen-4.12.0/tools/pygrub/src/pygrub 2019-04-01 21:27:36.179929105 +0100 @@ -963,5 +963,8 @@ ostring = format_simple(bootcfg["kernel"], bootcfg["ramdisk"], args, "\0") sys.stdout.flush() - os.write(fd, ostring) + if sys.version_info[0] < 3: + os.write(fd, ostring) + else: + os.write(fd, ostring.encode())