aio-libs / aiohttp

Asynchronous HTTP client/server framework for asyncio and Python
https://docs.aiohttp.org
Other
15.09k stars 2.01k forks source link

break in finally can swallow exception #9521

Open iritkatriel opened 3 hours ago

iritkatriel commented 3 hours ago

Describe the bug

There is a break in a finally clause in: https://github.com/aio-libs/aiohttp/blob/e7d1d6a488d89520f2f897d11004ad168884fe5f/aiohttp/web_protocol.py#L647

This can swallow any in-flight exception (like a BaseException from the try block or any exception from the except blocks).

See also https://docs.python.org/3/tutorial/errors.html#defining-clean-up-actions.

To Reproduce

N/A

Expected behavior

NA

Logs/tracebacks

NA

Python Version

Source code, main branch.

aiohttp Version

NA

multidict Version

NA

propcache Version

NA

yarl Version

NA

OS

All

Related component

Server

Additional context

No response

Code of Conduct

Dreamsorcerer commented 3 hours ago

7956

Feel free to fix it.