Commit a08023e6 authored by Nico Weber's avatar Nico Weber

compare_build_artifacts.py: json-encode backslash in string before replacing

The string is used to replace things in a json-encoded string, so it
needs to be json-encoded.

TBR=hans

Bug: 899438
Change-Id: Iababe77ed7f8c2dafd0d0443f28f480082bc72d0
Reviewed-on: https://chromium-review.googlesource.com/c/1347312Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610284}
parent 48636890
...@@ -188,8 +188,8 @@ def compare_files(first_filepath, second_filepath): ...@@ -188,8 +188,8 @@ def compare_files(first_filepath, second_filepath):
# build dir -- we care more about the hash differences than about # build dir -- we care more about the hash differences than about
# the name of the build dir. # the name of the build dir.
with open(second_filepath, 'rb') as f: with open(second_filepath, 'rb') as f:
lhs_cwd = lhs['relative_cwd'] lhs_cwd = lhs['relative_cwd'].replace('\\', '\\\\')
rhs_cwd = rhs['relative_cwd'] rhs_cwd = rhs['relative_cwd'].replace('\\', '\\\\')
json_contents = f.read() json_contents = f.read()
print >>sys.stderr, 'raw contents', second_filepath, ':', json_contents print >>sys.stderr, 'raw contents', second_filepath, ':', json_contents
json_contents = json_contents.replace(rhs_cwd, lhs_cwd) json_contents = json_contents.replace(rhs_cwd, lhs_cwd)
......
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