🐛 Bug Report: Client.call raises KeyError when error response omits Content-Type
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
👟 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.
- Lingua principale
- Python
- Stelle
- 265
- Fork
- 68
- Merge medio
- 5h 2m
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di appwrite/sdk-for-python
-
🚀 Feature: Python SDK does not validate row data against table schema before insertionForse di nuovo libera @pathariyashashi l’ha presa 33 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
appwrite/sdk-for-python#134 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Idea: Make SDK asynchronous.Forse di nuovo libera @stnguyen90 l’ha presa 1299 giorni fa e non c’è nessuna pull request aperta. Aperta
appwrite/sdk-for-python#26 · 16 commenti · 5 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di appwrite/sdk-for-python
Issue simili
-
breaking change
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
it-at-m/lhm_actions#441 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
TigreGotico/euskaphone#68 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ultralytics/ultralytics#27258 ·
I maintainer di solito rispondono entro 1 giorno