1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

cve-update-nvd2-native: always pass str for json.loads()

Currently json.loads() accepts one of the types str, bytes, or bytearray
as an argument, but bytes and bytearrays have only been allowed since
python 3.6. The version of Python3 provided by default on Ubuntu 16.04
and Debian 9.x is 3.5, so make raw_data type str to work correctly on
these build hosts.

(From OE-Core rev: 4efdf7a93254056b9ac47de470740ac113b031f2)

Signed-off-by: Yuta Hayama <hayama@lineo.co.jp>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
Yuta Hayama
2023-07-27 17:56:26 +09:00
committed by Steve Sakoman
parent 729e5e306f
commit 959e7b1432
@@ -136,7 +136,7 @@ def nvd_request_next(url, api_key, args):
if (r.headers['content-encoding'] == 'gzip'):
buf = r.read()
raw_data = gzip.decompress(buf)
raw_data = gzip.decompress(buf).decode("utf-8")
else:
raw_data = r.read().decode("utf-8")