aio-libs / aio-libs/aiohttp

Send explicit RuntimeError on response operations after session closing

Aperta
#2,202 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
16.5k
Fork
2.4k
Merge medio
17h 22m
PR unite (30g)
212

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.