Commit 3aa8f275 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

substitute surrogates in log file (#8076)

Summary:
Pull Request resolved: https://github.com/facebookincubator/resctl/pull/8076

D26025779 (https://github.com/facebook/folly/commit/4731bb0c37cc39a7a689a8369c9564eddeae146c) 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
parent e8955d38
...@@ -51,7 +51,7 @@ def run_cmd(cmd, env=None, cwd=None, allow_fail=False, log_file=None): ...@@ -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")) sys.stdout.buffer.write(msg.encode(errors="surrogateescape"))
if log_file is not None: 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): def log_function(msg):
log.write(msg) log.write(msg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment