Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/openai/auth/_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def k8s_service_account_token_provider(

def get_token() -> str:
try:
with open(token_file_path, "r") as f:
with open(token_file_path, "r", encoding="utf-8") as f:
token = f.read().strip()
if not token:
raise SubjectTokenProviderError(f"The token file at {token_file_path} is empty.")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_workload_identity_exchange_error() -> None:

def test_k8s_service_account_token_provider(tmp_path: Path) -> None:
token_file = tmp_path / "token"
token_file.write_text("my-k8s-token")
token_file.write_text("my-k8s-token", encoding="utf-8")

provider = k8s_service_account_token_provider(token_file)

Expand Down