aio-libs / aio-libs/aiohttp

Send explicit RuntimeError on response operations after session closing

Abierto
#2,202 1 comentario 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
16.5k
Forks
2.4k
Merge medio
17 h 22 min
PR fusionados (30 d)
212

Descripción

Extracted from [aio-libs chat](https://gitter.im/aio-libs/Lobby)

> aiohttp.client_exceptions.ClientConnectionError: Connection closed when a response is significantly large: https://pastebin.com/NmmnqhVt though I am new to async stuff so likely doing something wrong...

> this is because you move response out of session context and session closes connection

> Yes, I see.
> First snippet uses aiohttp incorrectly, I don't think we need fix our code.
> Reading response after session closing is mistake.
> Well, we could raise another explicit exception like RuntimeError but I doubt if we need it.

> We have to raise exception, otherwise it is very hard to find source of the problem especially for developers new to aiohttp

See also #2193

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.