diff --git a/.gitea/scripts/sop-checklist.py b/.gitea/scripts/sop-checklist.py index 40e3b81f6..28573cf4a 100644 --- a/.gitea/scripts/sop-checklist.py +++ b/.gitea/scripts/sop-checklist.py @@ -642,7 +642,7 @@ def load_config(path: str) -> dict[str, Any]: # requiring the dep, so the ignore is safe: if yaml loads, we use it; # otherwise we fall back silently. import yaml # type: ignore[import-not-found] - with open(path) as f: + with open(path, encoding="utf-8") as f: return yaml.safe_load(f) except ImportError: return _load_config_minimal(path) @@ -656,7 +656,7 @@ def _load_config_minimal(path: str) -> dict[str, Any]: item map: scalars + lists of scalars. Does NOT support nested lists, YAML anchors, multi-doc, or flow style. """ - with open(path) as f: + with open(path, encoding="utf-8") as f: lines = f.readlines() return _parse_minimal_yaml(lines) diff --git a/.gitea/scripts/tests/_refire_fixture.py b/.gitea/scripts/tests/_refire_fixture.py index 3844ba5c1..a64b2036d 100755 --- a/.gitea/scripts/tests/_refire_fixture.py +++ b/.gitea/scripts/tests/_refire_fixture.py @@ -33,7 +33,7 @@ def scenario() -> str: p = os.path.join(STATE_DIR, "scenario") if not os.path.isfile(p): return "T1_success" - with open(p) as f: + with open(p, encoding="utf-8") as f: return f.read().strip() diff --git a/.gitea/scripts/tests/_review_check_fixture.py b/.gitea/scripts/tests/_review_check_fixture.py index 265098265..bb0a52f8d 100644 --- a/.gitea/scripts/tests/_review_check_fixture.py +++ b/.gitea/scripts/tests/_review_check_fixture.py @@ -40,7 +40,7 @@ def scenario() -> str: p = os.path.join(STATE_DIR, "scenario") if not os.path.isfile(p): return "T1_pr_open" - with open(p) as f: + with open(p, encoding="utf-8") as f: return f.read().strip()