From 63a411d09af23a9c9945c03f64285c0310f088f7 Mon Sep 17 00:00:00 2001 From: Dhruvil Darji Date: Mon, 23 Feb 2026 05:07:01 -0800 Subject: [PATCH 1/2] Replace unintentional except BaseException with except Exception (#12130) --- aiohttp/client_proto.py | 2 +- aiohttp/http_parser.py | 4 ++-- aiohttp/worker.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aiohttp/client_proto.py b/aiohttp/client_proto.py index f2fbe108023..bb088b6a99c 100644 --- a/aiohttp/client_proto.py +++ b/aiohttp/client_proto.py @@ -325,7 +325,7 @@ def data_received(self, data: bytes) -> None: # parse http messages try: messages, upgraded, tail = self._parser.feed_data(data) - except BaseException as underlying_exc: + except Exception as underlying_exc: if self.transport is not None: # connection.release() could be called BEFORE # data_received(), the transport is already diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py index c2e0a8e1342..a939a61681f 100644 --- a/aiohttp/http_parser.py +++ b/aiohttp/http_parser.py @@ -446,8 +446,8 @@ def get_content_length() -> int | None: assert self._payload_parser is not None try: eof, data = self._payload_parser.feed_data(data[start_pos:], SEP) - except BaseException as underlying_exc: - reraised_exc = underlying_exc + except Exception as underlying_exc: + reraised_exc: BaseException = underlying_exc if self.payload_exception is not None: reraised_exc = self.payload_exception(str(underlying_exc)) diff --git a/aiohttp/worker.py b/aiohttp/worker.py index 375ac32e77f..cfe876f1f2c 100644 --- a/aiohttp/worker.py +++ b/aiohttp/worker.py @@ -122,7 +122,7 @@ async def _run(self) -> None: self.log.info("Parent changed, shutting down: %s", self) else: await self._wait_next_notify() - except BaseException: + except Exception: pass await runner.cleanup() From 4ec897bddfa84c23389d6bfe6764e549ba50b696 Mon Sep 17 00:00:00 2001 From: laurent b Date: Mon, 23 Feb 2026 14:38:19 +0100 Subject: [PATCH 2/2] Update Gunicorn documentation link (#12133) --- docs/logging.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/logging.rst b/docs/logging.rst index a18cb839a19..9d718fac16a 100644 --- a/docs/logging.rst +++ b/docs/logging.rst @@ -166,7 +166,7 @@ This also allows access to the results of coroutines on the ``request`` and Gunicorn access logs ^^^^^^^^^^^^^^^^^^^^ -When `Gunicorn `_ is used for +When `Gunicorn `_ is used for :ref:`deployment `, its default access log format will be automatically replaced with the default aiohttp's access log format.