From b3d6b8aa8d21217dd15008033d84994e9d1dfbd5 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 2 May 2018 12:30:11 +0200 Subject: Decode qtattributionsscanner output to UTF-8 Without the decode() step, the script may fail with TypeError: the JSON object must be str, not 'bytes' Task-number: PYSIDE-363 Change-Id: Ib9a8e487cc1b9f51692d0c4f20009a0c97cc770e Reviewed-by: Friedemann Kleint --- sources/pyside2/doc/qtattributionsscannertorst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/pyside2/doc') diff --git a/sources/pyside2/doc/qtattributionsscannertorst.py b/sources/pyside2/doc/qtattributionsscannertorst.py index af02103ef..ac651ca8d 100644 --- a/sources/pyside2/doc/qtattributionsscannertorst.py +++ b/sources/pyside2/doc/qtattributionsscannertorst.py @@ -119,7 +119,7 @@ def runScanner(directory, targetFileName): with open(targetFileName, 'w') as targetFile: targetFile.write(rstHeader) - for entry in json.loads(jsonS): + for entry in json.loads(jsonS.decode('utf-8')): name = entry['Name'] title = "{}\n{}".format(name, '-' * len(name)) brief = entry['License'] -- cgit v1.2.3