[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/15] analyze-migration.py: fix find() type error
From: |
Cleber Rosa |
Subject: |
[PULL 03/15] analyze-migration.py: fix find() type error |
Date: |
Tue, 17 Dec 2019 00:15:09 -0500 |
From: Marc-André Lureau <address@hidden>
Traceback (most recent call last):
File "../scripts/analyze-migration.py", line 611, in <module>
dump.read(desc_only = True)
File "../scripts/analyze-migration.py", line 513, in read
self.load_vmsd_json(file)
File "../scripts/analyze-migration.py", line 556, in load_vmsd_json
vmsd_json = file.read_migration_debug_json()
File "../scripts/analyze-migration.py", line 89, in read_migration_debug_json
nulpos = data.rfind("\0")
TypeError: argument should be integer or bytes-like object, not 'str'
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Signed-off-by: Cleber Rosa <address@hidden>
---
scripts/analyze-migration.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index e527eb168e..2b835d9b70 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -86,8 +86,8 @@ class MigrationFile(object):
# Find the last NULL byte, then the first brace after that. This should
# be the beginning of our JSON data.
- nulpos = data.rfind("\0")
- jsonpos = data.find("{", nulpos)
+ nulpos = data.rfind(b'\0')
+ jsonpos = data.find(b'{', nulpos)
# Check backwards from there and see whether we guessed right
self.file.seek(datapos + jsonpos - 5, 0)
--
2.21.0
- [PULL 00/15] Python queue 2019-12-17, Cleber Rosa, 2019/12/17
- [PULL 01/15] tests/boot_linux_console: Fetch assets from Debian snapshot archives, Cleber Rosa, 2019/12/17
- [PULL 02/15] Revert "Acceptance test: cancel test if m68k kernel packages goes missing", Cleber Rosa, 2019/12/17
- [PULL 03/15] analyze-migration.py: fix find() type error,
Cleber Rosa <=
- [PULL 04/15] analyze-migration.py: replace numpy with python 3.2, Cleber Rosa, 2019/12/17
- [PULL 05/15] python/qemu: Add set_qmp_monitor() to QEMUMachine, Cleber Rosa, 2019/12/17
- [PULL 06/15] tests/acceptance: Makes linux_initrd and empty_cpu_model use QEMUMachine, Cleber Rosa, 2019/12/17
- [PULL 07/15] Acceptance test x86_cpu_model_versions: use default vm, Cleber Rosa, 2019/12/17
- [PULL 08/15] Acceptance tests: introduce utility method for tags unique vals, Cleber Rosa, 2019/12/17
- [PULL 10/15] Acceptance tests: use relative location for tests, Cleber Rosa, 2019/12/17
- [PULL 09/15] Acceptance tests: use avocado tags for machine type, Cleber Rosa, 2019/12/17
- [PULL 11/15] python/qemu: Move kvm_available() to its own module, Cleber Rosa, 2019/12/17
- [PULL 12/15] python/qemu: accel: Add list_accel() method, Cleber Rosa, 2019/12/17
- [PULL 13/15] python/qemu: accel: Strengthen kvm_available() checks, Cleber Rosa, 2019/12/17