diff --git a/joj3_config_generator/main.py b/joj3_config_generator/main.py index abac533..989114f 100644 --- a/joj3_config_generator/main.py +++ b/joj3_config_generator/main.py @@ -82,6 +82,6 @@ def convert( result_dict = result_model.model_dump( mode="json", by_alias=True, exclude_none=True ) - with result_json_path.open("w") as result_file: + with result_json_path.open("w", newline="") as result_file: json.dump(result_dict, result_file, ensure_ascii=False, indent=4) result_file.write("\n") diff --git a/joj3_config_generator/models/const.py b/joj3_config_generator/models/const.py index b660c30..e969399 100644 --- a/joj3_config_generator/models/const.py +++ b/joj3_config_generator/models/const.py @@ -1,4 +1,4 @@ -from pathlib import Path +from pathlib import PurePosixPath from joj3_config_generator.models.common import Memory, Time @@ -9,9 +9,9 @@ DEFAULT_CASE_SCORE = 5 DEFAULT_CLOCK_LIMIT_MULTIPLIER = 2 DEFAULT_PROC_LIMIT = 50 -JOJ3_CONFIG_ROOT = Path("/home/tt/.config/joj") -TEAPOT_CONFIG_ROOT = Path("/home/tt/.config/teapot") -CACHE_ROOT = Path("/home/tt/.cache") +JOJ3_CONFIG_ROOT = PurePosixPath("/home/tt/.config/joj") +TEAPOT_CONFIG_ROOT = PurePosixPath("/home/tt/.config/teapot") +CACHE_ROOT = PurePosixPath("/home/tt/.cache") JOJ3_LOG_PATH = CACHE_ROOT / "joj3" / "joj3.log" TEAPOT_LOG_PATH = CACHE_ROOT / "joint-teapot-debug.log" ACTOR_CSV_PATH = JOJ3_CONFIG_ROOT / "students.csv" diff --git a/joj3_config_generator/transformers/task.py b/joj3_config_generator/transformers/task.py index 0fd9277..e9c1d9d 100644 --- a/joj3_config_generator/transformers/task.py +++ b/joj3_config_generator/transformers/task.py @@ -1,7 +1,7 @@ import re import shlex from functools import partial -from pathlib import Path +from pathlib import Path, PurePosixPath from typing import Any, Callable, Dict, List, Set, Tuple from joj3_config_generator.models import result, task @@ -262,7 +262,9 @@ def get_testcases( continue testcases.add( str( - testcases_path.relative_to((task_root / task_path).parent) + PurePosixPath( + testcases_path.relative_to((task_root / task_path).parent) + ) ).removesuffix(".in") ) return testcases