From 6e24cffe958df397c38e7b3085c16ae5d051cc92 Mon Sep 17 00:00:00 2001 From: Nick Budak Date: Wed, 4 Jun 2025 14:41:33 -0700 Subject: [PATCH] logging: Allow logging.exception helper to handle tracebacks. Although `Logger.exception` supports passing exception info with `exc_info`, when you use `logging.exception` keyword arguments are not forwarded to the root logger, which makes passing `exc_info` raise `TypeError`. Signed-off-by: Nick Budak --- python-stdlib/logging/logging.py | 4 ++-- python-stdlib/logging/manifest.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python-stdlib/logging/logging.py b/python-stdlib/logging/logging.py index f4874df7d..551bf7152 100644 --- a/python-stdlib/logging/logging.py +++ b/python-stdlib/logging/logging.py @@ -202,8 +202,8 @@ def critical(msg, *args): getLogger().critical(msg, *args) -def exception(msg, *args): - getLogger().exception(msg, *args) +def exception(msg, *args, exc_info=True): + getLogger().exception(msg, *args, exc_info=exc_info) def shutdown(): diff --git a/python-stdlib/logging/manifest.py b/python-stdlib/logging/manifest.py index d9f0ee886..c2614e9ea 100644 --- a/python-stdlib/logging/manifest.py +++ b/python-stdlib/logging/manifest.py @@ -1,3 +1,3 @@ -metadata(version="0.6.1") +metadata(version="0.6.2") module("logging.py")