fix encoding to be able to run on win (#502)

This commit is contained in:
Denini Gabriel 2025-08-18 05:19:45 -03:00 committed by GitHub
parent b8aa55704b
commit 02b7fac863
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"]