From a409167f6479caa4b896daa4a9fbdee71ae1d0ae Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Thu, 22 May 2025 04:27:03 +1000 Subject: [PATCH] core: Reconfigure stdout to utf8 (#5017) --- Utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Utils.py b/Utils.py index f930335b..f4752448 100644 --- a/Utils.py +++ b/Utils.py @@ -540,6 +540,7 @@ def init_logging(name: str, loglevel: typing.Union[str, int] = logging.INFO, if add_timestamp: stream_handler.setFormatter(formatter) root_logger.addHandler(stream_handler) + sys.stdout.reconfigure(encoding="utf-8", errors="replace") # Relay unhandled exceptions to logger. if not getattr(sys.excepthook, "_wrapped", False): # skip if already modified