Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

PathLike upload tuples fail with an opaque connection error

オープン
#196 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api

調査の方向性

Start with is_file_content() and _transform_file(), which handle the shared upload path for certificate, extension, and session uploads. Run the existing upload tests and add sync and async coverage for PathLike values in the supported tuple shapes. Done means tuple uploads read the path while preserving the custom filename, content type, and optional headers.

索引モデルが issue の本文から書いたものです。

説明

What happened?

A bare Path works as an upload, but the tuple form accepted by FileTypes does not:

from pathlib import Path

client.sessions.uploads.create(
    "session-id",
    file=("custom.md", Path("README.md"), "text/markdown"),
)

On current main at 5f5274b, this raises:

APIConnectionError: Connection error.

The underlying cause is:

AttributeError: 'PosixPath' object has no attribute 'read'

The same path is shared by certificate, extension, and session uploads.

Why it happens

is_file_content() treats every tuple as terminal file content. That means _transform_file() returns the tuple unchanged before its tuple-handling branch can read the PathLike value inside it. HTTPX later receives the raw Path and tries to call .read() on it.

Expected behavior

A PathLike inside any supported upload tuple should be read just like a bare Path, while preserving the custom filename, content type, and optional headers.

I have a small fix ready that keeps tuples separate from direct file content and adds sync and async coverage for all three supported tuple shapes.

主要言語
Python
スター
93
フォーク
16
平均マージ
11分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

browserbase/sdk-python のほかの issue

browserbase/sdk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。