From de29ff9bd2d4fed9dbad2c378d20baae2dd80c92 Mon Sep 17 00:00:00 2001 From: Julien Plu Date: Mon, 4 Jan 2021 16:22:15 +0100 Subject: [PATCH] Fix open (#9368) --- utils/check_repo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/check_repo.py b/utils/check_repo.py index 5fd890a34..7cd80232d 100644 --- a/utils/check_repo.py +++ b/utils/check_repo.py @@ -315,7 +315,7 @@ def find_all_documented_objects(): """ Parse the content of all doc files to detect which classes and functions it documents""" documented_obj = [] for doc_file in Path(PATH_TO_DOC).glob("**/*.rst"): - with open(doc_file) as f: + with open(doc_file, "r", encoding="utf-8", newline="\n") as f: content = f.read() raw_doc_objs = re.findall(r"(?:autoclass|autofunction):: transformers.(\S+)\s+", content) documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs]