1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-24 15:26:15 +00:00

Update detect.py

Fix UnicodeEncodeError on cp932 environments by adding errors="replace" to log file open
This commit is contained in:
Ruw
2025-09-18 19:32:03 +09:00
committed by GitHub
parent 8b4b93a82e
commit b23b0dde9a

View File

@@ -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)): if not caught and (is_cl and re_cl_capture.match(line)) or (not is_cl and re_link_capture.match(line)):
caught = True caught = True
try: 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") log.write(line + "\n")
except OSError: except OSError:
print_warning(f'Failed to log captured line: "{line}".') print_warning(f'Failed to log captured line: "{line}".')