aboutsummaryrefslogtreecommitdiff
path: root/cros_utils
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2023-03-29 13:59:25 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-29 22:43:39 +0000
commit613b5005fa93aa29aafe291c27b0df73604d6ee3 (patch)
treea520b51d36b653cffaf633bf6359cfe9c51b0ca0 /cros_utils
parent5b2e1a8789e2b62e99685c6762c42a6dd2ee6d1f (diff)
downloadtoolchain-utils-613b5005fa93aa29aafe291c27b0df73604d6ee3.tar.gz
bugs: fix cros-lint errors
I forgot to pass `encoding` here way back when - oops. BUG=b:275742850 TEST=cros lint Change-Id: I05a221dbdb32865b96e086d29bf251311297e6fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4382437 Commit-Queue: George Burgess <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'cros_utils')
-rwxr-xr-xcros_utils/bugs.py2
-rwxr-xr-xcros_utils/bugs_test.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/cros_utils/bugs.py b/cros_utils/bugs.py
index 98c85ecd..c2c6ca22 100755
--- a/cros_utils/bugs.py
+++ b/cros_utils/bugs.py
@@ -79,7 +79,7 @@ def _WriteBugJSONFile(object_type: str, json_object: Dict[str, Any]):
)
temp_path = file_path + ".in_progress"
try:
- with open(temp_path, "w") as f:
+ with open(temp_path, "w", encoding="utf-8") as f:
json.dump(final_object, f)
os.rename(temp_path, file_path)
except:
diff --git a/cros_utils/bugs_test.py b/cros_utils/bugs_test.py
index 2c3213fa..1b58e984 100755
--- a/cros_utils/bugs_test.py
+++ b/cros_utils/bugs_test.py
@@ -48,7 +48,7 @@ class Tests(unittest.TestCase):
f"Expected {file_path} to start with {tempdir}",
)
- with open(file_path) as f:
+ with open(file_path, encoding="utf-8") as f:
self.assertEqual(
json.load(f),
{