mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
.pytool/LicenseCheck: Open files in utf-8
The LicenseCheck plugin currently fails if a file contains characters outside the platform-dependent encoding returned from locale.getencoding(). This change updates the encoding to utf-8 so the plugin is more robust while continuing to support backward compatibility with the ASCII range. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
This commit is contained in:
parent
b8602d8fee
commit
260d36484d
@ -70,7 +70,7 @@ class LicenseCheck(ICiBuildPlugin):
|
||||
temp_diff_output = os.path.join (temp_path, 'diff.txt')
|
||||
params = "diff --output={} --unified=0 origin/master HEAD".format(temp_diff_output)
|
||||
RunCmd("git", params)
|
||||
with open(temp_diff_output) as file:
|
||||
with open(temp_diff_output, encoding='utf8') as file:
|
||||
patch = file.read().strip().split("\n")
|
||||
# Delete temp directory
|
||||
if os.path.exists(temp_path):
|
||||
|
Loading…
x
Reference in New Issue
Block a user