]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
cve-update-nvd2-native: always pass str for json.loads()
authorYuta Hayama <hayama@lineo.co.jp>
Thu, 27 Jul 2023 08:56:26 +0000 (17:56 +0900)
committerSteve Sakoman <steve@sakoman.com>
Sat, 12 Aug 2023 15:38:11 +0000 (05:38 -1000)
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 <hayama@lineo.co.jp>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-core/meta/cve-update-nvd2-native.bb

index 2f7dad7e821b58dda157e84b8a5818460073809a..67d76f75dd6a3b1d5b297656f1def22320b888e8 100644 (file)
@@ -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")