public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1] MinPlatformPkg/Fsp: Rebase fail when python tools path exist whitespace
@ 2021-05-24  0:34 IanX Kuo
  0 siblings, 0 replies; only message in thread
From: IanX Kuo @ 2021-05-24  0:34 UTC (permalink / raw)
  To: devel; +Cc: IanX Kuo, Chasel Chiu, Nate DeSimone

From: IanX Kuo <ianx.kuo@intel.com>

(a) C:\Users\<UserName>\AppData\Local\Program\Python\Python38
(b) C:\Python38
(c) C:\Program Files\Python38
Issue only happens on (a) and (c).
(a) happen on <UserName> have whitespace. Ex: Tony Chen
(c) happen on "Program Files" have whitespace.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
---
 .../Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py            | 6 +++++-
 .../MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py     | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
index 406e5ec130..de2d49d55e 100644
--- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
+++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddress.py
@@ -1,6 +1,6 @@
 ## @ RebaseAndPatchFspBinBaseAddress.py
 #
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -76,6 +76,10 @@ file.close()
 pythontool = 'python'
 if 'PYTHON_HOME' in os.environ:
     pythontool = os.environ['PYTHON_HOME'] + os.sep + 'python'
+else:
+    pythontool = sys.executable
+pythontool = "\"" + pythontool + "\""
+
 Process = subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fspBinFilePath], stdout=subprocess.PIPE)
 Output = Process.communicate()[0]
 FsptInfo = Output.rsplit(b"FSP_M", 1);
diff --git a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py
index fb4cf4f9b7..d9adb78ca2 100644
--- a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py
+++ b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseFspBinBaseAddress.py
@@ -1,6 +1,6 @@
 ## @ RebaseFspBinBaseAddress.py
 #
-# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -70,6 +70,8 @@ if 'PYTHON_HOME' in os.environ:
     pythontool = os.environ['PYTHON_HOME'] + os.sep + 'python'
 else:
     pythontool = sys.executable
+pythontool = "\"" + pythontool + "\""
+
 Process = subprocess.Popen([pythontool, splitFspBinPath, "info","-f",fspBinFilePath], stdout=subprocess.PIPE)
 Output = Process.communicate()[0]
 FsptInfo = Output.rsplit(b"FSP_M", 1);
-- 
2.30.0.windows.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-24  0:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24  0:34 [PATCH v1] MinPlatformPkg/Fsp: Rebase fail when python tools path exist whitespace IanX Kuo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox