Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 3 additions & 1 deletion sdks/python/tests/test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 4 additions & 0 deletions sdks/python/tool/conformance_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading