Skip to content

Use UTF-8 when reading Bedrock test fixtures#3530

Open
Ghraven wants to merge 1 commit into
openai:mainfrom
GhravenLabs:fix/bedrock-fixtures-utf8
Open

Use UTF-8 when reading Bedrock test fixtures#3530
Ghraven wants to merge 1 commit into
openai:mainfrom
GhravenLabs:fix/bedrock-fixtures-utf8

Conversation

@Ghraven

@Ghraven Ghraven commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • Read Bedrock JSON/JSONL fixture files with encoding="utf-8" instead of the platform default encoding.
  • Keep the opt-in Bedrock live env-file reader deterministic across developer machines.

Problem

These test fixtures and optional live-test env files are text inputs with repo-controlled formats, but Path.read_text() defaults to the host locale. On Windows or other non-UTF-8 locales, that can make the Bedrock tests less portable than they need to be.

Before / After

Before: Bedrock fixture loading depended on the platform default text encoding.

After: the fixture and env-file readers explicitly decode as UTF-8.

Verification

  • python -m py_compile tests/lib/test_bedrock_auth_conformance.py tests/lib/bedrock_live.py
  • uv run --with pytest --with pytest-asyncio --with pytest-xdist --with jsonschema --with respx --with botocore python -m pytest -q tests/lib/test_bedrock_auth_conformance.py (20 passed)

@Ghraven
Ghraven requested a review from a team as a code owner July 23, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant