diff --git a/homeassistant/util/logging.py b/homeassistant/util/logging.py index 9216993eb53..8dba52ebe9d 100644 --- a/homeassistant/util/logging.py +++ b/homeassistant/util/logging.py @@ -33,6 +33,15 @@ class HideSensitiveDataFilter(logging.Filter): class HomeAssistantQueueHandler(logging.handlers.QueueHandler): """Process the log in another thread.""" + def prepare(self, record: logging.LogRecord) -> logging.LogRecord: + """Prepare a record for queuing. + + This is added as a workaround for https://bugs.python.org/issue46755 + """ + record = super().prepare(record) + record.stack_info = None + return record + def handle(self, record: logging.LogRecord) -> Any: """ Conditionally emit the specified logging record.