aio-libs / aio-libs/aiohttp

Send explicit RuntimeError on response operations after session closing

Đang mở
#2,202 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
16.5k
Fork
2.4k
Merge trung bình
17 giờ 22 phút
Pull request đã merge (30 ngày)
212

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.