summaryrefslogtreecommitdiffstats
path: root/BaseTools/Scripts
diff options
context:
space:
mode:
authorFan, ZhijuX <zhijux.fan@intel.com>2019-03-01 10:52:24 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-03-06 09:17:33 +0800
commit8ef3a6ec1f6a858bb14c40715db90c1e3927cced (patch)
tree79755781a0f43d4eeef78ddd90de68cdd626278f /BaseTools/Scripts
parentc3947b54235c93e4f41d6d56b1f5296a9f8021d5 (diff)
downloadedk2-8ef3a6ec1f6a858bb14c40715db90c1e3927cced.tar.gz
edk2-8ef3a6ec1f6a858bb14c40715db90c1e3927cced.tar.bz2
edk2-8ef3a6ec1f6a858bb14c40715db90c1e3927cced.zip
BaseTools:Run packagedoc_cli.py to generate doc failed
The reason for this problem is that the file was opened incorrectly. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rw-r--r--BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py7
1 files changed, 4 insertions, 3 deletions
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