From 02b7fac86358f7ef6239608b0b738a5a03ecfe9e Mon Sep 17 00:00:00 2001 From: Denini Gabriel Date: Mon, 18 Aug 2025 05:19:45 -0300 Subject: [PATCH] fix encoding to be able to run on win (#502) --- reasoning_gym/data/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reasoning_gym/data/__init__.py b/reasoning_gym/data/__init__.py index a88fda73..bfff2eb7 100644 --- a/reasoning_gym/data/__init__.py +++ b/reasoning_gym/data/__init__.py @@ -15,7 +15,7 @@ def get_data_file_path(filename: str) -> Path: Example: >>> path = get_data_file_path("pg19362.txt") - >>> with open(path) as f: + >>> with open(path, encoding="utf-8") as f: ... content = f.read() """ return resources.files("reasoning_gym.data").joinpath(filename) @@ -33,7 +33,7 @@ def read_data_file(filename: str) -> str: Example: >>> content = read_data_file("pg19362.txt") """ - return resources.files("reasoning_gym.data").joinpath(filename).read_text() + return resources.files("reasoning_gym.data").joinpath(filename).read_text(encoding="utf-8") __all__ = ["get_data_file_path", "read_data_file"]