tools/python: fix Python3.4 TypeError in format string
authorOlaf Hering <olaf@aepfle.de>
Thu, 1 Jul 2021 09:56:01 +0000 (11:56 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 15 Jul 2021 10:59:32 +0000 (11:59 +0100)
commitbb9377a20559de07e1dbe91399902c70cfafccea
treee009a890ffbdfd5599568e4a9815266c8c765e86
parentf6aec84fe7076d03ac8509de97275e9ef3da37cd
tools/python: fix Python3.4 TypeError in format string

Using the first element of a tuple for a format specifier fails with
python3.4 as included in SLE12:
    b = b"string/%x" % (i, )
TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'

It happens to work with python 2.7 and 3.6.
To support older Py3, format as strings and explicitly encode as ASCII.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
(cherry picked from commit a27976a1080d537fb1f212a8f9133d60daa0025b)
tools/python/scripts/convert-legacy-stream