Skip to content

fix: add missing f-string prefix in async_to_httpx_files error message#1481

Closed
xodn348 wants to merge 1 commit intoanthropics:mainfrom
xodn348:fix/async-files-fstring
Closed

fix: add missing f-string prefix in async_to_httpx_files error message#1481
xodn348 wants to merge 1 commit intoanthropics:mainfrom
xodn348:fix/async-files-fstring

Conversation

@xodn348
Copy link
Copy Markdown

@xodn348 xodn348 commented May 1, 2026

What

The TypeError raised in async_to_httpx_files() was missing the f prefix on its format string, causing the error message to literally print {type(files)} instead of the actual type. The sync counterpart to_httpx_files() already had the correct f-string (line 60).

Before (line 102):

raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence")
# Output: "Unexpected file type input {type(files)}, expected mapping or sequence"

After:

raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence")
# Output: "Unexpected file type input <class 'int'>, expected mapping or sequence"

Verification

  • Build: pass
  • Tests: pass (16 passed)
  • Lint: pass
  • Type check: pass

The TypeError in async_to_httpx_files() was missing the f-string prefix,
causing the error message to literally print '{type(files)}' instead of
the actual type. The sync counterpart to_httpx_files() already had the
correct f-string. Added tests for both sync and async error messages.
@xodn348 xodn348 requested a review from a team as a code owner May 1, 2026 05:19
@karpetrosyan
Copy link
Copy Markdown
Collaborator

Thanks for the PR! I've fixed it in our codegen, see commit (06d109a)

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.

2 participants