You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LogRecord should normalize falsy exc_info values #158839
According to the documentation, the exc_info argument to the log() group of function can be any falsy value to indicate that no exception information is provided. It's common to use either None or False here.
When a truthy value is provided, it is normalized to an exception info tuple before passing it to LogRecord. A falsy value is passed on unchanged:
This contradicts LogRecords documentation, which says that only None is accepted and that the exc_info field can be a tuple or None. The mypy primer run in python/typeshed#16466 shows that a few projects make this assumption. For example, sphinx:
changed the title [-][logging] `LogRecord` should normalize falsy `exc_info` values[/-][+]`LogRecord` should normalize falsy `exc_info` values[/+]on Oct 5, 2026
Activity
[-][logging] `LogRecord` should normalize falsy `exc_info` values[/-][+]`LogRecord` should normalize falsy `exc_info` values[/+]