From b23b0dde9a42a33f0c63958e5841f3d89980707e Mon Sep 17 00:00:00 2001 From: Ruw Date: Thu, 18 Sep 2025 19:32:03 +0900 Subject: [PATCH] Update detect.py Fix UnicodeEncodeError on cp932 environments by adding errors="replace" to log file open --- platform/windows/detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 518a5cf6732..1a2345c4a33 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -316,7 +316,7 @@ def configure_msvc(env: "SConsEnvironment"): if not caught and (is_cl and re_cl_capture.match(line)) or (not is_cl and re_link_capture.match(line)): caught = True try: - with open(capture_path, "a", encoding=sys.stdout.encoding) as log: + with open(capture_path, "a", encoding=sys.stdout.encoding, errors="replace") as log: log.write(line + "\n") except OSError: print_warning(f'Failed to log captured line: "{line}".')