From 7a62f62197e89b4641d5dffce8271c2817d99aaf Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Fri, 24 Jul 2026 23:17:51 +0500 Subject: [PATCH] fix: explicit encoding for faulthandler file open (ruff PLW1514) --- gateway/run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gateway/run.py b/gateway/run.py index a82bb50f0760..9496617bf483 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -7777,9 +7777,10 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew ) _faulthandler_path = os.path.join(_log_dir, "gateway_faulthandler.log") os.makedirs(_log_dir, exist_ok=True) + _fh = open(_faulthandler_path, "a", encoding="utf-8") faulthandler.register( signal.SIGUSR2, - file=open(_faulthandler_path, "a"), + file=_fh, all_threads=True, chain=True, )