🐛 Bug Report: Client.call raises KeyError when error response omits Content-Type
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start with the synthetic response reproduction in the issue and inspect appwrite/client.py where Client.call handles the HTTP 502 response. Check how the SDK maps failed responses to AppwriteException, then identify the generator or source that owns this read-only SDK before proposing a change. Done means the missing Content-Type no longer causes KeyError and the original status and body surface through AppwriteException.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
👟 Reproduction steps
With SDK 27.0.0, use a synthetic requests.Response and patch requests.request so no network request is made:
from unittest.mock import patch
from requests import Response
from appwrite.client import Client
response = Response()
response.status_code = 502
response.url = "https://cloud.appwrite.io/v1/synthetic"
response._content = b"upstream unavailable"
response.headers = {} # valid response without a Content-Type header
with patch("appwrite.client.requests.request", return_value=response):
Client().call("get", "/synthetic")
👍 Expected behavior
The failed HTTP response should surface as AppwriteException (including its status/body where available), consistent with the SDK's documented error behavior.
👎 Actual Behavior
The call raises KeyError: 'Content-Type' from appwrite/client.py while handling the HTTP 502, hiding the original HTTP failure and bypassing AppwriteException.
🎲 Appwrite version
Different version (specify in environment): SDK package 27.0.0; no live Appwrite server was used.
💻 Operating system
Windows
🧱 Your Environment
CPython 3.13, requests 2.34.2. The reproduction patches the request function and uses only a synthetic response; it sends no network request and uses no credentials.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find a similar issue. I reviewed the related client-error report #108 and searched existing issues for
Content-TypeandKeyError AppwriteException; neither reports this missing-header failure.
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
The SDK README describes this repository as auto-generated, and the repository's bot told PR #162 that direct pull requests are not accepted. I'm reporting the reproducible behavior here rather than editing generated code; please route the fix through the appropriate generator/source if applicable.
- Vorherrschende Sprache
- Python
- Sterne
- 265
- Forks
- 68
- Ø Merge
- 5 Std. 2 Min.
- Gemergte PRs (30 T.)
- 8
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus appwrite/sdk-for-python
-
🚀 Feature: Python SDK does not validate row data against table schema before insertionEvtl. wieder frei @pathariyashashi hat das vor 33 Tagen übernommen, und es ist kein Pull Request offen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
appwrite/sdk-for-python#134 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Idea: Make SDK asynchronous.Evtl. wieder frei @stnguyen90 hat das vor 1299 Tagen übernommen, und es ist kein Pull Request offen. Offen
appwrite/sdk-for-python#26 · 16 Kommentare · 5 Reaktionen · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in appwrite/sdk-for-python
Ähnliche Issues
-
breaking change
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
it-at-m/lhm_actions#441 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
TigreGotico/euskaphone#68 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
bug triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
ultralytics/ultralytics#27258 ·
Maintainer antworten meist innerhalb von 1 Tag