🐛 Bug Report: Client.call raises KeyError when error response omits Content-Type
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
👟 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.
- Lenguaje dominante
- Python
- Estrellas
- 265
- Forks
- 68
- Merge medio
- 5 h 2 min
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de appwrite/sdk-for-python
-
🚀 Feature: Python SDK does not validate row data against table schema before insertionQuizá libre de nuevo @pathariyashashi la tomó hace 33 días y no hay ningún pull request abierto. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
appwrite/sdk-for-python#134 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Idea: Make SDK asynchronous.Quizá libre de nuevo @stnguyen90 la tomó hace 1299 días y no hay ningún pull request abierto. Abierto
appwrite/sdk-for-python#26 · 16 comentarios · 5 reacciones · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de appwrite/sdk-for-python
Issues similares
-
breaking change
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
it-at-m/lhm_actions#441 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
TigreGotico/euskaphone#68 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ultralytics/ultralytics#27258 ·
Los mantenedores suelen responder en 1 día