On Mon, 22 Jul 2019, Andrew Cooper wrote:

> On 22/07/2019 03:57, Kevin Buckley wrote:
>> bash-5.0# /usr/lib/xen/bin/pygrub --debug --offset=1048576
>> --list-entries /dev/vg_xen_vbds/lv_4g_02
>> Using <class 'grub.GrubConf.Grub2ConfigFile'> to parse /boot/grub/grub.cfg
>> Traceback (most recent call last):
>>   File "/usr/lib/xen/bin/pygrub", line 907, in <module>
>>     chosencfg = run_grub(file, entry, fs, incfg["args"])
>>   File "/usr/lib/xen/bin/pygrub", line 625, in run_grub
>>     g = Grub(file, fs)
>>   File "/usr/lib/xen/bin/pygrub", line 249, in __init__
>>     self.read_config(file, fs)
>>   File "/usr/lib/xen/bin/pygrub", line 460, in read_config
>>     self.cf.parse(buf)
>>   File "/usr/lib/python3.7/site-packages/grub/GrubConf.py", line 376, in 
>> parse
>>     lines = buf.split("\n")
>> TypeError: a bytes-like object is required, not 'str'
>>
>> ...
>>
>> Ok, so then I went hunting around for the cause of the error
>> I was seeing on the LFS system and got pointed towards the
>> cause being a Pythin2->3 issue, with the way 3 now differentiates
>> between strings and bytes.
>
> Yes - this looks like a Py 2/3 compatibility issue.  This particular one
> is related to
> https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=ff915c8cacc264ae1380d51fea07267b8308d7ba
>
> However, I can't explain why python is complaining at str.split(). 
> split() is a string operation, not a bytes operation.

It looks like you are missing the above patch and I think you also need
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=485079e816788d70169f45579e1f5a8f909dc1b3
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=767ba397d34848c7e0c4e9cdfc5efa4e0cb61442
and perhaps
https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=a57a1b26ec0ae31f924cf2bbcf479637d007be44
if you build with ocaml. Actually the first of these 3 patches is optional 
as it is just an error message change but should allow the second patch to 
apply cleanly.

        Michael Young
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to