fix: repair broken imports and test failures after codex_auth move
lint / lint (push) Successful in 1m29s

- codex_auth.py: fix relative imports (.log, .util) to absolute paths
  (bot_bottle.log, bot_bottle.util) — the file moved to contrib/codex
  but the imports weren't updated
- codex_auth.py: wrap long line at 107 chars (pre-existing C0301)
- pty_resize.py: catch io.UnsupportedOperation from stream.fileno()
  and fall back to the numeric fd — pytest redirects stdin/stdout/stderr
  to pseudofiles, causing fileno() to raise before ioctl is even called

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-04 18:11:55 +00:00
parent 0f5d484151
commit 295d65e4ef
2 changed files with 11 additions and 4 deletions
+5 -3
View File
@@ -15,8 +15,8 @@ from datetime import datetime, timezone
from pathlib import Path
from typing import cast
from .log import die
from .util import expand_tilde
from bot_bottle.log import die
from bot_bottle.util import expand_tilde
def codex_auth_path(host_env: dict[str, str] | None = None) -> Path:
@@ -153,7 +153,9 @@ def _dummy_jwt_from_host(
return _dummy_jwt(now, exp_ts=exp_ts)
if not isinstance(payload, dict):
return _dummy_jwt(now, exp_ts=exp_ts)
return _encode_dummy_jwt(_redact_jwt_payload(cast(dict[str, object], payload), now=now, exp_ts=exp_ts))
return _encode_dummy_jwt(
_redact_jwt_payload(cast(dict[str, object], payload), now=now, exp_ts=exp_ts)
)
def _encode_dummy_jwt(payload: dict[str, object]) -> str: