Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#9,187 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@eavanvalkenburg is already working on this.

Since Oct 8, 2026.

  • #9188 by @BlueRaddish — open

Assessment

This issue has not been assessed yet.

Description

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.

Dominant language
Python
Stars
13.9k
Forks
2.4k
Avg merge
1d 19h
Merged PRs (30d)
439

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/agent-framework

All issues in microsoft/agent-framework

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.