From 409c3aca433b6d22e5a8c97b0012f95cdc4bf5b3 Mon Sep 17 00:00:00 2001 From: Abby Austin <38941820+spidertyler2005@users.noreply.github.com> Date: Sun, 2 Aug 2026 21:55:40 -0400 Subject: [PATCH] bug fix in the way that Path's are formatted inside of the toml writer. --- comprehensiveconfig/toml.py | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/comprehensiveconfig/toml.py b/comprehensiveconfig/toml.py index 6486ab6..b41222d 100644 --- a/comprehensiveconfig/toml.py +++ b/comprehensiveconfig/toml.py @@ -75,10 +75,12 @@ def format_value(cls, field, value) -> str: match value: case bool(): return "true" if value else "false" - case int() | float() | Path(): + case int() | float(): return str(value) case str(): return f'"{escape(value)}"' + case Path(): + return f'"{escape(str(value).replace("\\", "/"))}"' case list(): return f"[{", ".join([str(cls.format_value(field, inner_val)) for inner_val in value])}]" case dict(): diff --git a/pyproject.toml b/pyproject.toml index 509c524..b297e20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "comprehensiveconfig" -version = "1.2.0" +version = "1.2.1" description = "A library to create ergonomic, auto-validated configuration models with great support for static type annotations." readme = "readme.md" requires-python = ">=3.12"