]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools:Run packagedoc_cli.py to generate doc failed
authorFan, ZhijuX <zhijux.fan@intel.com>
Fri, 1 Mar 2019 02:52:24 +0000 (10:52 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Wed, 6 Mar 2019 01:17:33 +0000 (09:17 +0800)
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>
BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxygengen.py

index e31df262bc9f71898402adf60473afca6704f03c..73349e2f48eb2b601b4c76f128021da590ddf84f 100644 (file)
@@ -376,9 +376,10 @@ class PackageDocumentAction(DoxygenAction):
             return\r
 \r
         try:\r
-            f = open(path, 'r')\r
-            lines = f.readlines()\r
-            f.close()\r
+            with open(path, 'r') as f:\r
+                lines = f.readlines()\r
+        except UnicodeDecodeError:\r
+            return\r
         except IOError:\r
             ErrorMsg('Fail to open file %s' % path)\r
             return\r