From 76e7a44deef7e699370550aacb022c29efe1aa00 Mon Sep 17 00:00:00 2001 From: Julien Plu Date: Mon, 9 Nov 2020 13:50:38 +0100 Subject: [PATCH] Fix some tooling for windows (#8359) * Fix some tooling for windows * Fix conflict * Trigger CI --- utils/check_repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/check_repo.py b/utils/check_repo.py index 99132ab02e..b23eb13230 100644 --- a/utils/check_repo.py +++ b/utils/check_repo.py @@ -163,7 +163,7 @@ def get_model_doc_files(): def find_tested_models(test_file): """ Parse the content of test_file to detect what's in all_model_classes""" # This is a bit hacky but I didn't find a way to import the test_file as a module and read inside the class - with open(os.path.join(PATH_TO_TESTS, test_file)) as f: + with open(os.path.join(PATH_TO_TESTS, test_file), "r", encoding="utf-8") as f: content = f.read() all_models = re.findall(r"all_model_classes\s+=\s+\(\s*\(([^\)]*)\)", content) # Check with one less parenthesis @@ -221,7 +221,7 @@ def check_all_models_are_tested(): def find_documented_classes(doc_file): """ Parse the content of doc_file to detect which classes it documents""" - with open(os.path.join(PATH_TO_DOC, doc_file)) as f: + with open(os.path.join(PATH_TO_DOC, doc_file), "r", encoding="utf-8") as f: content = f.read() return re.findall(r"autoclass:: transformers.(\S+)\s+", content)