From 1ffeedcf558b1edb9229998a6f3056484fd1b4e5 Mon Sep 17 00:00:00 2001 From: 0xallam Date: Sat, 10 Jan 2026 14:46:01 -0800 Subject: [PATCH] fix: handle chmod failure on Windows gracefully Co-Authored-By: Claude Opus 4.5 --- strix/config/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/strix/config/config.py b/strix/config/config.py index 351b080..63c2dc4 100644 --- a/strix/config/config.py +++ b/strix/config/config.py @@ -1,3 +1,4 @@ +import contextlib import json import os from pathlib import Path @@ -77,11 +78,11 @@ class Config: config_path = cls.config_file() with config_path.open("w", encoding="utf-8") as f: json.dump(config, f, indent=2) - config_path.chmod(0o600) except OSError: return False - else: - return True + with contextlib.suppress(OSError): + config_path.chmod(0o600) # may fail on Windows + return True @classmethod def apply_saved(cls) -> dict[str, str]: