On 10/15/21 15:16, Laurent Vivier wrote:
> When we try to use 'analyze-migration.py -x' with python3,
> we have the following errors:
> 
>   Traceback (most recent call last):
>     File "scripts/analyze-migration.py", line 593, in <module>
>       f.write(jsonenc.encode(dump.vmsd_desc))
>   TypeError: a bytes-like object is required, not 'str'
> 
>   Traceback (most recent call last):
>     File "scripts/analyze-migration.py", line 601, in <module>
>       f.write(jsonenc.encode(dict))
>   TypeError: a bytes-like object is required, not 'str'
> 
> This happens because the file 'f' is open in binary mode while
> jsonenc.encode() returns a string.
> 
> The results are human-readable files, 'desc.json' and 'state.json',
> so there is no reason to use the binary mode.
> 
> Signed-off-by: Laurent Vivier <lviv...@redhat.com>
> ---
>  scripts/analyze-migration.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com>


Reply via email to