Skip to content

fix(files): read PathLike content in upload tuples - #197

Open
danielgaskins wants to merge 1 commit into
browserbase:mainfrom
danielgaskins:fix/pathlike-upload-tuples
Open

danielgaskins wants to merge 1 commit into
browserbase:mainfrom
danielgaskins:fix/pathlike-upload-tuples

Conversation

@danielgaskins

Copy link
Copy Markdown

Fixes #196.

A bare Path was normalized before upload, but a PathLike inside a multipart tuple was passed through unchanged. HTTPX then tried to call .read() on the path and the SDK surfaced an APIConnectionError.

Tuple inputs now reach the existing sync and async content readers. The filename, content type, and optional headers are preserved.

Added regression coverage for all three supported tuple shapes in both sync and async code.

Checked with:

  • 30 focused tests
  • Ruff
  • Pyright
  • Mypy

@danielgaskins
danielgaskins requested a review from a team as a code owner September 21, 2026 17:55
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.

PathLike upload tuples fail with an opaque connection error

1 participant