mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-20 16:51:37 +00:00
crit: fix python3 encoding issues
Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com>
This commit is contained in:
parent
4c46cbc4d8
commit
2e656222d7
1 changed files with 3 additions and 3 deletions
|
|
@ -244,7 +244,7 @@ class ghost_file_handler:
|
|||
while True:
|
||||
gc = pb.ghost_chunk_entry()
|
||||
buf = f.read(4)
|
||||
if buf == '':
|
||||
if len(buf) == 0:
|
||||
break
|
||||
size, = struct.unpack('i', buf)
|
||||
gc.ParseFromString(f.read(size))
|
||||
|
|
@ -252,13 +252,13 @@ class ghost_file_handler:
|
|||
if no_payload:
|
||||
f.seek(gc.len, os.SEEK_CUR)
|
||||
else:
|
||||
entry['extra'] = base64.encodebytes(f.read(gc.len))
|
||||
entry['extra'] = base64.encodebytes(f.read(gc.len)).decode('utf-8')
|
||||
entries.append(entry)
|
||||
else:
|
||||
if no_payload:
|
||||
f.seek(0, os.SEEK_END)
|
||||
else:
|
||||
g_entry['extra'] = base64.encodebytes(f.read())
|
||||
g_entry['extra'] = base64.encodebytes(f.read()).decode('utf-8')
|
||||
entries.append(g_entry)
|
||||
|
||||
return entries
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue