From a5fb8ddae4ba3c2ed7925f871e99a3a766db174d Mon Sep 17 00:00:00 2001 From: 2ez4mii Date: Wed, 19 Nov 2025 23:32:35 +0900 Subject: [PATCH] Fix wrong file open mode and undefined variable in path_to_file_list --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 0d1f17b..505432a 100644 --- a/main.py +++ b/main.py @@ -2,7 +2,8 @@ def path_to_file_list(path: str) -> List[str]: """Reads a file and returns a list of lines in the file""" - li = open(path, 'w') + with open(path, 'r', encoding='utf-8') as f: + lines = f.read().strip().split("\n") return lines def train_file_list_to_json(english_file_list: List[str], german_file_list: List[str]) -> List[str]: