From 80c039dfc53ad6889acadfaa76a23969a0b31734 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Tue, 26 Jan 2021 14:38:40 -0800 Subject: [PATCH] substitute surrogates in log file (#8076) Summary: Pull Request resolved: https://github.com/facebookincubator/resctl/pull/8076 D26025779 (https://github.com/facebook/proxygen/commit/2b96889a0f3fb337184c419912da4c131fe5a915) may have broken the getdeps build when logging surrogates. Use errors=surrogateescape to try to avoid that. Reviewed By: danobi Differential Revision: D26079717 fbshipit-source-id: 98d938bfced417e0b39a6dcddb241225ffb69c06 --- build/fbcode_builder/getdeps/runcmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/fbcode_builder/getdeps/runcmd.py b/build/fbcode_builder/getdeps/runcmd.py index 1b2eaccf6..44e7994aa 100644 --- a/build/fbcode_builder/getdeps/runcmd.py +++ b/build/fbcode_builder/getdeps/runcmd.py @@ -51,7 +51,7 @@ def run_cmd(cmd, env=None, cwd=None, allow_fail=False, log_file=None): sys.stdout.buffer.write(msg.encode(errors="surrogateescape")) if log_file is not None: - with open(log_file, "a", encoding="utf-8") as log: + with open(log_file, "a", encoding="utf-8", errors="surrogateescape") as log: def log_function(msg): log.write(msg)