# Text, Markdown and JSON readers accept streams with non-string names

> Agno's TextReader, MarkdownReader and JSONReader now read a file object whose name is an integer or None, such as a stream opened with os.fdopen, and name the document with a default.

- Published: 2026-10-08
- Author: pei711
- Categories: Changelog
- Canonical: https://www.agno.com/blog/text-markdown-and-json-readers-accept-streams-with-non-string-names
- Markdown: https://www.agno.com/blog/text-markdown-and-json-readers-accept-streams-with-non-string-names.md

Agno's readers build a document name from `file.name`, and a stream opened from a file descriptor, like `os.fdopen(fd, "rb")` on a `tempfile.mkstemp()` handle, reports an integer there. Earlier releases called `.split(".")` on it. `TextReader` and `MarkdownReader` logged the error and returned nothing, and `JSONReader` raised. All three now fall back to a default name.

Real output reading a descriptor-backed temporary file with each reader:

```text
Before: TextReader     name 3 -> 0 docs []
        MarkdownReader name 4 -> 0 docs []
        JSONReader     -> AttributeError 'int' object has no attribute 'split'

Now:    TextReader     name 3 -> 1 docs ['text_file']
        MarkdownReader name 4 -> 1 docs ['file']
        JSONReader     name 3 -> 1 docs ['json_file']
```

The fix covers `read()` and `async_read()` on the text and Markdown readers. A `name=` argument still wins over the default.

See the [cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/07_knowledge/09_archive/readers/json_reader.py), and learn more about [readers](https://docs.agno.com/knowledge/concepts/readers/overview), the [Markdown reader](https://docs.agno.com/knowledge/concepts/readers/markdown-reader) and the [JSON reader](https://docs.agno.com/knowledge/concepts/readers/json-reader) in the documentation.
