qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Alexey Kirillov <lekiravi@yandex-team.ru>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, yc-core@yandex-team.ru
Subject: Re: [PATCH 1/1] analyze-migration.py: fix read_migration_debug_json() return type
Date: Mon, 27 Jul 2020 15:52:34 -0400	[thread overview]
Message-ID: <20200727195234.GD225270@habkost.net> (raw)
In-Reply-To: <20200715152135.20287-1-lekiravi@yandex-team.ru>

On Wed, Jul 15, 2020 at 06:21:35PM +0300, Alexey Kirillov wrote:
> Since we use result of read_migration_debug_json() as JSON formatted string,
> we must provide proper type. Before Python 3.6 json.loads() method
> support only str typed input.
> 
> Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru>

Queued for 5.2, thanks!

I've added a small comment explaining why the explicit decode()
call is needed.

        # explicit decode() needed for Python 3.5 compatibility
        return data[jsonpos:jsonpos + jsonlen].decode("utf-8")

> ---
>  scripts/analyze-migration.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
> index 95838cbff3..c5f06482cf 100755
> --- a/scripts/analyze-migration.py
> +++ b/scripts/analyze-migration.py
> @@ -97,7 +97,7 @@ class MigrationFile(object):
>          # Seek back to where we were at the beginning
>          self.file.seek(entrypos, 0)
>  
> -        return data[jsonpos:jsonpos + jsonlen]
> +        return data[jsonpos:jsonpos + jsonlen].decode("utf-8")
>  
>      def close(self):
>          self.file.close()
> -- 
> 2.25.1
> 
> 

-- 
Eduardo



      parent reply	other threads:[~2020-07-27 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 15:21 [PATCH 1/1] analyze-migration.py: fix read_migration_debug_json() return type Alexey Kirillov
2020-07-15 16:06 ` Philippe Mathieu-Daudé
2020-07-27 19:52 ` Eduardo Habkost [this message]

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=20200727195234.GD225270@habkost.net \
    --to=ehabkost@redhat.com \
    --cc=lekiravi@yandex-team.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=yc-core@yandex-team.ru \
    /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).