scripts: update open calls to use explicit encoding
BUG=b:187789896
TEST=`cros lint` is clean here
Change-Id: Ia54475869c17292505537334362cd4cff6438b14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4290041
Commit-Queue: Cindy Lin <xcl@google.com>
Reviewed-by: Cindy Lin <xcl@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/pushimage.py b/scripts/pushimage.py
index a7c377c..d0eab00 100644
--- a/scripts/pushimage.py
+++ b/scripts/pushimage.py
@@ -89,7 +89,7 @@
self.buildroot = buildroot or constants.SOURCE_ROOT
config = configparser.ConfigParser()
- with open(self.GetInsnFile("DEFAULT")) as fp:
+ with open(self.GetInsnFile("DEFAULT"), encoding="utf-8") as fp:
config.read_file(fp)
# What pushimage internally refers to as 'recovery', are the basic signing
@@ -101,7 +101,7 @@
if not os.path.exists(input_insns):
# This board doesn't have any signing instructions.
raise MissingBoardInstructions(self.board, image_type, input_insns)
- with open(input_insns) as fp:
+ with open(input_insns, encoding="utf-8") as fp:
config.read_file(fp)
if image_type is not None:
@@ -113,7 +113,7 @@
)
self.image_type = image_type
- with open(input_insns) as fp:
+ with open(input_insns, encoding="utf-8") as fp:
config.read_file(fp)
self.cfg = config