[PR #266] [MERGED] _stream in async client raises RuntimeError when processing HTTP errors #441

Closed
opened 2026-02-15 16:30:25 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama-python/pull/266
Author: @Oneirag
Created: 8/28/2024
Status: Merged
Merged: 8/29/2024
Merged by: @mxyng

Base: mainHead: main


📝 Commits (1)

  • 1088e5a _stream in async client raises RuntimeError processing HTTP errors

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 ollama/_client.py (+1 -1)

📄 Description

When response received in AsyncClient._stream has an HTTP error, the process raises a RuntimeError("Attempted to call a sync iterator on an async stream.") due to the use of e.response.read() instead of await e.response.aread()


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama-python/pull/266 **Author:** [@Oneirag](https://github.com/Oneirag) **Created:** 8/28/2024 **Status:** ✅ Merged **Merged:** 8/29/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`1088e5a`](https://github.com/ollama/ollama-python/commit/1088e5a645d310d88e21566f0576a4cb658b9715) _stream in async client raises RuntimeError processing HTTP errors ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `ollama/_client.py` (+1 -1) </details> ### 📄 Description When response received in AsyncClient._stream has an HTTP error, the process raises a RuntimeError("Attempted to call a sync iterator on an async stream.") due to the use of e.response.read() instead of await e.response.aread() --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 16:30:25 -05:00
yindo closed this issue 2026-02-15 16:30:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#441