From c622622c5924b291db302aa22f4d82608677ceed Mon Sep 17 00:00:00 2001 From: Ujjwal Verma Date: Sun, 5 Feb 2017 18:59:01 +0530 Subject: Encoding fixes and tests --- examples/complex/har_dump.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/complex/har_dump.py') diff --git a/examples/complex/har_dump.py b/examples/complex/har_dump.py index 62011903..f7c1e658 100644 --- a/examples/complex/har_dump.py +++ b/examples/complex/har_dump.py @@ -7,6 +7,7 @@ import json import sys import base64 import zlib +import os from datetime import datetime import pytz @@ -166,7 +167,7 @@ def done(): if dump_file.endswith('.zhar'): raw = zlib.compress(raw, 9) - with open(dump_file, "wb") as f: + with open(os.path.expanduser(dump_file), "wb") as f: f.write(raw) mitmproxy.ctx.log("HAR dump finished (wrote %s bytes to file)" % len(json_dump)) -- cgit v1.2.3