diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index b7c464760..6141bc1c7 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -172,9 +172,8 @@ def save_body(path, master, state, content): state.last_saveload = path path = os.path.expanduser(path) try: - f = file(path, "wb") - f.write(str(content)) - f.close() + with file(path, "wb") as f: + f.write(content) except IOError, v: master.statusbar.message(v.strerror) diff --git a/setup.py b/setup.py index f9c8d15e8..9a19aab93 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ deps = { "pyOpenSSL>=0.14", "tornado>=4.0.2", "configargparse>=0.9.3", - "pyperclip>=1.5.7" + "pyperclip>=1.5.8" } script_deps = { "mitmproxy": {