diff --git a/scripts/gen_meta.py b/scripts/gen_meta.py index e871856..b0e31cd 100644 --- a/scripts/gen_meta.py +++ b/scripts/gen_meta.py @@ -56,7 +56,7 @@ def render_meta(*, protocol_version: int = 1) -> str: client_methods = data.get("clientMethods", {}) protocol_methods = data.get("protocolMethods") version = data.get("version", 1) - header_lines = [f"# Generated from {meta_json.relative_to(ROOT)}. Do not edit by hand."] + header_lines = [f"# Generated from {meta_json.relative_to(ROOT).as_posix()}. Do not edit by hand."] if version_file.exists(): ref = version_file.read_text("utf-8").strip() if ref: @@ -74,6 +74,7 @@ def render_meta(*, protocol_version: int = 1) -> str: [sys.executable, "-m", "ruff", "format", "--stdin-filename", str(out_py), "-"], input=source, text=True, + encoding="utf-8", capture_output=True, check=False, cwd=ROOT, diff --git a/scripts/gen_schema.py b/scripts/gen_schema.py index dc1c4d0..6c9f0ab 100644 --- a/scripts/gen_schema.py +++ b/scripts/gen_schema.py @@ -176,7 +176,7 @@ def _deserialize_field_specs(definition: dict[str, Any]) -> tuple[list[str], lis def _build_header(schema_json: Path, version_file: Path) -> str: - lines = [f"# Generated from {schema_json.relative_to(ROOT)}. Do not edit by hand."] + lines = [f"# Generated from {schema_json.relative_to(ROOT).as_posix()}. Do not edit by hand."] if version_file.exists() and (ref := version_file.read_text(encoding="utf-8").strip()): lines.append(f"# Schema ref: {ref}") return "\n".join(lines) @@ -192,6 +192,7 @@ def _format_python(source: str, schema_out: Path) -> str: [sys.executable, "-m", "ruff", *arguments, "--stdin-filename", str(schema_out), "-"], input=source, text=True, + encoding="utf-8", capture_output=True, check=False, cwd=ROOT,