From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Cleber Rosa <crosa@redhat.com>,
Michael Tokarev <mjt@tls.msk.ru>,
Eduardo Habkost <ehabkost@redhat.com>,
Laurent Vivier <laurent@vivier.eu>
Subject: Re: [PATCH 2/2] analyze-migration.py: fix extract contents ('-x') errors
Date: Fri, 15 Oct 2021 16:21:01 +0200 [thread overview]
Message-ID: <25f4a871-36b7-dc14-929b-54e7d568f3be@redhat.com> (raw)
In-Reply-To: <20211015131645.501281-3-lvivier@redhat.com>
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 <lvivier@redhat.com>
> ---
> scripts/analyze-migration.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2021-10-15 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 13:16 [PATCH 0/2] analyze-migration.py: trivial fixes Laurent Vivier
2021-10-15 13:16 ` [PATCH 1/2] analyze-migration.py: fix a long standing typo Laurent Vivier
2021-10-15 13:24 ` Philippe Mathieu-Daudé
2021-10-15 13:16 ` [PATCH 2/2] analyze-migration.py: fix extract contents ('-x') errors Laurent Vivier
2021-10-15 14:21 ` Philippe Mathieu-Daudé [this message]
2021-10-19 7:56 ` [PATCH 0/2] analyze-migration.py: trivial fixes Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25f4a871-36b7-dc14-929b-54e7d568f3be@redhat.com \
--to=philmd@redhat.com \
--cc=crosa@redhat.com \
--cc=ehabkost@redhat.com \
--cc=laurent@vivier.eu \
--cc=lvivier@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).