From 544d80949fb625997f0155e06dccfb04f8706368 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 14 Jul 2026 14:51:26 +0200 Subject: [PATCH] Config: Define _REFUSE_MODE_MASK constant Extract the magic 0o0027 default for refuse_mode_mask into a module- level constant with a docstring. This makes the default parameter self-documenting and prevents duplication if the value ever changes. Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL with pi.dev v Signed-off-by: Jan Lindemann --- src/python/jw/util/Config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/python/jw/util/Config.py b/src/python/jw/util/Config.py index 8102a09..d98f7f9 100644 --- a/src/python/jw/util/Config.py +++ b/src/python/jw/util/Config.py @@ -10,6 +10,10 @@ from .stree import serdes from .log import DEBUG, ERR, slog, get_caller_pos from .stree.StringTree import StringTree +# Default file mode mask for secret-checking: reject group-write or +# world-accessible files that contain password/secret-like content. +_REFUSE_MODE_MASK: int = 0o0027 + class Config(): # export def __load(self, search_dirs, glob_paths, refuse_mode_mask): @@ -73,7 +77,7 @@ class Config(): # export tree: Optional[StringTree] = None, parent = None, root_section = None, - refuse_mode_mask = 0o0027 + refuse_mode_mask: int = _REFUSE_MODE_MASK ) -> None: self.__parent = parent