HOTFIX: ensure path casting in tools
Some checks failed
Ruff / ruff (push) Waiting to run
Mypy / mypy (push) Successful in 1m11s
Pytest / pytest (3.12) (push) Has been cancelled
Pytest / pytest (3.13) (push) Has been cancelled
Pytest / pytest (3.14) (push) Has been cancelled

This commit is contained in:
Justus Kuhlmann 2026-05-06 16:50:39 +02:00
commit fbf802959a
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -89,6 +89,7 @@ def set_config(path: Path, section: str, option: str, value: Any) -> None:
value: Any
The value we set the option to.
"""
path = Path(path)
config_path = path / CONFIG_FILENAME
config = ConfigParser()
if os.path.exists(config_path):
@ -115,6 +116,7 @@ def get_db_file(path: Path) -> Path:
db_file: str
The file holding the database.
"""
path = Path(path)
if not os.path.exists(path):
raise FileNotFoundError(f"Corrlib path {path} does not exist.")
config_path = path / CONFIG_FILENAME
@ -142,6 +144,7 @@ def cache_enabled(path: Path) -> bool:
cached_bool: bool
Whether the given library is cached.
"""
path = Path(path)
config_path = path / CONFIG_FILENAME
config = ConfigParser()
if os.path.exists(config_path):