aio-libs / aio-libs/aiohttp

Send explicit RuntimeError on response operations after session closing

オープン
#2,202 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
16.5k
フォーク
2.4k
平均マージ
17時間 22分
マージ済み PR(30日)
212

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。