From: Alexey Kirillov <lekir...@yandex-team.ru> 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 <lekir...@yandex-team.ru> Message-Id: <20200715152135.20287-1-lekir...@yandex-team.ru> [ehabkost: added comment explaining why decode() is needed} Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- scripts/analyze-migration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py index 95838cbff3..d70ec7d33a 100755 --- a/scripts/analyze-migration.py +++ b/scripts/analyze-migration.py @@ -97,7 +97,8 @@ class MigrationFile(object): # Seek back to where we were at the beginning self.file.seek(entrypos, 0) - return data[jsonpos:jsonpos + jsonlen] + # explicit decode() needed for Python 3.5 compatibility + return data[jsonpos:jsonpos + jsonlen].decode("utf-8") def close(self): self.file.close() -- 2.26.2