diff options
author | Ujjwal Verma <ujjwalverma1111@gmail.com> | 2017-02-05 18:59:01 +0530 |
---|---|---|
committer | Ujjwal Verma <ujjwalverma1111@gmail.com> | 2017-02-05 18:59:01 +0530 |
commit | c622622c5924b291db302aa22f4d82608677ceed (patch) | |
tree | 0a077d07fdb37850c08a473a32103450dc224d7c /examples/complex/har_dump.py | |
parent | 2316c0fb74efefd76970c685b8f77f45834f1490 (diff) | |
download | mitmproxy-c622622c5924b291db302aa22f4d82608677ceed.tar.gz mitmproxy-c622622c5924b291db302aa22f4d82608677ceed.tar.bz2 mitmproxy-c622622c5924b291db302aa22f4d82608677ceed.zip |
Encoding fixes and tests
Diffstat (limited to 'examples/complex/har_dump.py')
-rw-r--r-- | examples/complex/har_dump.py | 3 |
1 files changed, 2 insertions, 1 deletions
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)) |