From 8ef3a6ec1f6a858bb14c40715db90c1e3927cced Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Fri, 1 Mar 2019 10:52:24 +0800 Subject: BaseTools:Run packagedoc_cli.py to generate doc failed The reason for this problem is that the file was opened incorrectly. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Reviewed-by: Bob Feng --- .../plugins/EdkPlugins/edk2/model/doxygengen.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'BaseTools/Scripts') diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py index e31df262bc..73349e2f48 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py @@ -376,9 +376,10 @@ class PackageDocumentAction(DoxygenAction): return try: - f = open(path, 'r') - lines = f.readlines() - f.close() + with open(path, 'r') as f: + lines = f.readlines() + except UnicodeDecodeError: + return except IOError: ErrorMsg('Fail to open file %s' % path) return -- cgit v1.2.3