From: Yuta Hayama Date: Thu, 27 Jul 2023 08:56:26 +0000 (+0900) Subject: cve-update-nvd2-native: always pass str for json.loads() X-Git-Tag: 2022-04.12-kirkstone~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e67d659847afe648de1b1eca2d19c4f6375dd12c;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git 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. Signed-off-by: Yuta Hayama Signed-off-by: Steve Sakoman --- diff --git a/meta/recipes-core/meta/cve-update-nvd2-native.bb b/meta/recipes-core/meta/cve-update-nvd2-native.bb index 2f7dad7e821..67d76f75dd6 100644 --- a/meta/recipes-core/meta/cve-update-nvd2-native.bb +++ b/meta/recipes-core/meta/cve-update-nvd2-native.bb @@ -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")