Open JSON file in text mode
This commit is contained in:
parent
2c9240fd22
commit
456f80d862
|
@ -120,7 +120,7 @@ def done():
|
|||
mitmproxy.ctx.log(pprint.pformat(HAR))
|
||||
# TODO: .zhar compression
|
||||
else:
|
||||
with open(dump_file, "wb") as f:
|
||||
with open(dump_file, "w") as f:
|
||||
f.write(json.dumps(HAR, indent=2))
|
||||
|
||||
# TODO: Log results via mitmproxy.ctx.log
|
||||
|
|
|
@ -128,7 +128,7 @@ class TestHARDump(mastertest.MasterTest):
|
|||
self.invoke(m, "response", self.req_get)
|
||||
m.addons.remove(sc)
|
||||
|
||||
with open(path, "rb") as inp:
|
||||
with open(path, "r") as inp:
|
||||
har = json.load(inp)
|
||||
|
||||
assert len(har["log"]["entries"]) == 1
|
||||
|
|
Loading…
Reference in New Issue