]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Correct BPDG tool error prints
authorKonstantin Aladyshev <aladyshev22@gmail.com>
Mon, 5 Sep 2022 09:19:23 +0000 (17:19 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Oct 2022 06:32:07 +0000 (06:32 +0000)
Popen communication returns bytestrings. It is necessary to perform
decode on these strings before passing them to the EdkLogger that
works with ordinary strings.

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/Common/VpdInfoFile.py

index 4249b9f899e7728516cf01ac42db8fb405535e69..1e0c3dfe76830b8460315b89877cdec14850c011 100644 (file)
@@ -248,8 +248,8 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName):
         PopenObject.wait()\r
 \r
     if PopenObject.returncode != 0:\r
-        EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error))\r
+        EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(error.decode()))\r
         EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to execute BPDG tool with exit code: %d, the error message is: \n %s" % \\r
-                            (PopenObject.returncode, str(error)))\r
+                            (PopenObject.returncode, str(error.decode())))\r
 \r
     return PopenObject.returncode\r