From 741819681407226f581dace34e63bf61ae01a181 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Mon, 30 Aug 2021 11:10:52 +0200 Subject: [PATCH] Specificy encoding when opening rust-toolchain file This probably is just ASCII. --- deploy.py | 2 +- fuzz/make_corpus.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index 4909ef5..18e1ed9 100755 --- a/deploy.py +++ b/deploy.py @@ -308,7 +308,7 @@ class OpenSKInstaller: def update_rustc_if_needed(self): target_toolchain_fullstring = "stable" - with open("rust-toolchain", "r") as f: + with open("rust-toolchain", "r", encoding="utf-8") as f: target_toolchain_fullstring = f.readline().strip() target_toolchain = target_toolchain_fullstring.split("-", maxsplit=1) if len(target_toolchain) == 1: diff --git a/fuzz/make_corpus.py b/fuzz/make_corpus.py index 11c8575..a6bd9ff 100644 --- a/fuzz/make_corpus.py +++ b/fuzz/make_corpus.py @@ -29,7 +29,7 @@ def make_corpus(corpus_dir, corpus_json): if os.path.isfile(corpus_json) and \ os.path.splitext(corpus_json)[-1] == ".json": - with open(corpus_json) as corpus_file: + with open(corpus_json, encoding="utf-8") as corpus_file: corpus = json.load(corpus_file) else: raise TypeError