From 14f9cec7132bc60f9839048b0a0f8ef7ae9ed64c Mon Sep 17 00:00:00 2001 From: Alexey Kirillov Date: Wed, 15 Jul 2020 18:21:35 +0300 Subject: analyze-migration.py: fix read_migration_debug_json() return type 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 Message-Id: <20200715152135.20287-1-lekiravi@yandex-team.ru> [ehabkost: added comment explaining why decode() is needed} Signed-off-by: Eduardo Habkost --- scripts/analyze-migration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py index 95838cb..d70ec7d 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() -- cgit v1.1