From c7303fdb894d7da10c4f6f51e206165c00ee781a Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 16 Oct 2026 11:55:36 +0200 Subject: [PATCH 1/2] Fix LogRecord.__init__ --- stdlib/logging/__init__.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index f0864154b9e1..0671351b3c6a 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -312,8 +312,8 @@ class LogRecord: args: _ArgsType | None asctime: str created: float - # Logger._log() only normalizes truthy exc_info values so - # exc_info=False ends up on the record unchanged. + # Prior to Python 3.16, Logger._log() only normalizes truthy exc_info + # values so exc_info=False ends up on the record unchanged. exc_info: _SysExcInfoType | Literal[False] | None exc_text: str | None filename: str @@ -345,7 +345,7 @@ class LogRecord: lineno: int, msg: object, args: _ArgsType | None, - exc_info: _SysExcInfoType | Literal[False] | None, + exc_info: _SysExcInfoType | None, func: str | None = None, sinfo: str | None = None, ) -> None: ... From 8724ad256772030a911037cd79d124b29c0f36bc Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 16 Oct 2026 12:00:41 +0200 Subject: [PATCH 2/2] Update comments --- stdlib/logging/__init__.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index 0671351b3c6a..d7799e3c948f 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -307,8 +307,9 @@ class Filter: def filter(self, record: LogRecord) -> bool: ... class LogRecord: - # args can be set to None by logging.handlers.QueueHandler - # (see https://bugs.python.org/issue44473) + # args can be set to None by logging.handlers.QueueHandler, which + # contradicts the LogRecord documentation, but seems to be intentional, + # see https://github.com/python/cpython/issues/88639 args: _ArgsType | None asctime: str created: float @@ -344,6 +345,9 @@ class LogRecord: pathname: str, lineno: int, msg: object, + # args can be set to None by logging.handlers.QueueHandler, which + # contradicts the LogRecord documentation, but seems to be intentional, + # see https://github.com/python/cpython/issues/88639 args: _ArgsType | None, exc_info: _SysExcInfoType | None, func: str | None = None,