criu/lib/py
Adrian Reber 8017b6a8e6 lib: fix recode errors seen in Jenkins
Although we are running crit-recode.py also in all CI runs we never seen
following error except in Jenkins:

Traceback (most recent call last):
  File "/usr/lib/python3.8/base64.py", line 510, in _input_type_check
    m = memoryview(s)
TypeError: memoryview: a bytes-like object is required, not 'str'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./test/crit-recode.py", line 25, in recode_and_check
    r_img = pycriu.images.dumps(pb)
  File "/var/lib/jenkins/workspace/Q/test/pycriu/images/images.py", line 635, in dumps
    dump(img, f)
  File "/var/lib/jenkins/workspace/Q/test/pycriu/images/images.py", line 626, in dump
    handler.dump(img['entries'], f)
  File "/var/lib/jenkins/workspace/Q/test/pycriu/images/images.py", line 289, in dump
    f.write(base64.decodebytes(item['extra']))
  File "/usr/lib/python3.8/base64.py", line 545, in decodebytes
    _input_type_check(s)
  File "/usr/lib/python3.8/base64.py", line 513, in _input_type_check
    raise TypeError(msg) from err
TypeError: expected bytes-like object, not str

This commit fixes this by encoding the string to bytes.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-03-14 10:25:30 -07:00
..
images lib: fix recode errors seen in Jenkins 2021-03-14 10:25:30 -07:00
.gitignore python lib: rename rpc.py to rpc_pb2.py 2016-10-10 12:49:28 +03:00
__init__.py crit: make crit python2/python3 compatible 2018-07-09 18:25:16 +03:00
cli.py lib/cli.py: Open out file as a binary 2021-03-09 22:22:15 -08:00
criu.py py: Fix tabs in code comments 2019-09-07 15:59:57 +03:00
Makefile build: Reused .FORCE from nmk 2017-11-23 20:23:14 +03:00