From e8f20f0feb0435148482f30000a7b306aed65941 Mon Sep 17 00:00:00 2001 From: Dennis Paler Date: Sat, 21 Nov 2026 23:26:01 +0800 Subject: [PATCH 1/2] ci(python-wheels): install the pinned toolchain with rustup show On windows-latest the job failed before compiling anything: dtolnay installed stable, then cargo fetched the rust-toolchain.toml pin and rustup refused to add clippy (detected conflict: bin\cargo-clippy.exe). release.yml's native builds already use `rustup show`, which installs exactly the pin. --- .github/workflows/python-wheels.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 5fd2e88..582051d 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -46,8 +46,11 @@ jobs: with: python-version: ${{ matrix.python }} + # The toolchain rust-toolchain.toml pins, as release.yml installs it: + # installing `stable` first and letting cargo fetch the pin conflicts on + # Windows runners (clippy's cargo-clippy.exe already present). - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + run: rustup show - name: Build the wheel on this platform run: | From 0a9887f63a3ea9b8f84565959f949c1df975845e Mon Sep 17 00:00:00 2001 From: Dennis Paler Date: Sat, 21 Nov 2026 23:36:54 +0800 Subject: [PATCH 2/2] test(sdk-python): read the shared vectors as UTF-8 (Windows) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Path.read_text() decodes with the locale encoding, cp1252 on Windows, which turned the unicode-user-key case's 'ユーザー-ü' into 'ユーザー-ü' — a different user, a different rollout bucket, and 2 failures on windows-x86_64. The SDK itself already reads and writes UTF-8 explicitly (offline cache, SSE, snapshots); only the test fixture was wrong. The conformance adapter's stdin gets the same treatment. --- sdks/python/tests/test_vectors.py | 4 +++- sdks/python/tool/conformance_adapter.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sdks/python/tests/test_vectors.py b/sdks/python/tests/test_vectors.py index f67f62e..9c226d9 100644 --- a/sdks/python/tests/test_vectors.py +++ b/sdks/python/tests/test_vectors.py @@ -14,7 +14,9 @@ from checkgate import CheckgateClient from checkgate._core import Engine -DOC = json.loads(VECTORS.read_text()) +# UTF-8 explicitly: the default is the locale encoding (cp1252 on Windows), +# which garbles the non-ASCII user key of the `unicode-user-key` case. +DOC = json.loads(VECTORS.read_text(encoding="utf-8")) CASES = DOC["cases"] OPTIONAL = ("rule_index", "rollout_bucket", "variant_index") diff --git a/sdks/python/tool/conformance_adapter.py b/sdks/python/tool/conformance_adapter.py index 446465f..73a0cab 100644 --- a/sdks/python/tool/conformance_adapter.py +++ b/sdks/python/tool/conformance_adapter.py @@ -47,6 +47,10 @@ def main() -> None: else: logging.getLogger("checkgate").setLevel(logging.CRITICAL + 1) client: Optional[CheckgateClient] = None + # The suite writes UTF-8; Python would otherwise decode the pipe with the + # locale encoding (cp1252 on Windows) and garble non-ASCII keys. + if hasattr(sys.stdin, "reconfigure"): + sys.stdin.reconfigure(encoding="utf-8") for line in sys.stdin: if not line.strip(): continue