From 464670a65ed323c5412593f9fb7623b8ab414609 Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Tue, 3 Jun 2025 00:14:22 +0200 Subject: [PATCH] Hotfix: makedirs before yaml.dump --- src/serena/util/general.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/serena/util/general.py b/src/serena/util/general.py index bfddaf47..b350ae18 100644 --- a/src/serena/util/general.py +++ b/src/serena/util/general.py @@ -1,3 +1,4 @@ +import os from typing import Literal, overload from ruamel.yaml import YAML @@ -26,5 +27,6 @@ def load_yaml(path: str, preserve_comments: bool = False) -> dict | CommentedMap def save_yaml(path: str, data: dict | CommentedMap, preserve_comments: bool = False) -> None: yaml = _create_YAML(preserve_comments) + os.makedirs(os.path.dirname(path), exist_ok=True) with open(path, "w", encoding="utf-8") as f: yaml.dump(data, f)