2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

lib: fix crit-recode msgque errors in Jenkins

b'test/dump/zdtm/static/msgque/63/1/ipcns-msg-11.img'  encode fails: expected bytes-like object, not str
b'test/dump/zdtm/static/msgque/63/1/ipcns-msg-11.img' pretty  encode fails: expected bytes-like object, not str
FAIL

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber
2021-07-14 14:40:47 +00:00
committed by Andrei Vagin
parent 5034885974
commit 7e86519fe3

View File

@@ -443,7 +443,10 @@ class ipc_msg_queue_handler:
f.write(struct.pack('i', size))
f.write(msg_str)
rounded = round_up(msg.msize, sizeof_u64)
data = base64.decodebytes(extra[i + 1])
if (sys.version_info > (3, 0)):
data = base64.decodebytes(str.encode(extra[i + 1]))
else:
data = base64.decodebytes(extra[i + 1])
f.write(data[:msg.msize])
f.write(b'\0' * (rounded - msg.msize))