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

Python: [Bug]: Media type detection documentation examples contain invalid base64

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

メンテナーはふだん 1 日以内に返信

@eavanvalkenburg がすでに取り組んでいます。

2026年10月8日 から。

  • #9188 @BlueRaddish による — オープン

評価

この issue はまだ評価されていません。

説明

agents python reproduced
Description

The public detect_media_type_from_base64 docstring includes two examples whose base64 payloads end in .... Executing either raises ValueError: Invalid base64 data provided. instead of returning the documented image/png value.

Minimal reproduction
from agent_framework import detect_media_type_from_base64

detect_media_type_from_base64(data_str="iVBORw0KGgo...")
detect_media_type_from_base64(data_uri="data:image/png;base64,iVBORw0KGgo...")

Each call fails independently. The detector validates base64 input, so abbreviated payloads cannot be executed as written.

Expected behavior and proposed fix

Use the valid base64-encoded PNG signature iVBORw0KGgo= in both documentation examples. The function identifies magic bytes, so those signature bytes are sufficient to demonstrate detection; they are not a complete image file. This is a documentation-only correction with no runtime or API changes.

Verification

Reproduced on Python 3.13.16 against main commit 40763bed1a5e94a1698ba9ebf009e5622eb099aa. Both code examples were extracted from the source docstring and executed locally. They fail before the correction and each returns image/png afterward. No model calls, credentials, or services were used.

I am preparing the focused documentation correction and checked for an existing overlapping issue or PR. Report and patch prepared with assistance from OpenAI Codex.

主要言語
Python
スター
13.9k
フォーク
2.4k
平均マージ
1日 19時間
マージ済み PR(30日)
439

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

microsoft/agent-framework のほかの issue

microsoft/agent-framework の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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