From c643234c985ff320f15f0e2047f91a5076ea332d Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 24 Jul 2012 03:06:12 +0200 Subject: [PATCH] fix -r option, read file in binary mode --- libmproxy/console/__init__.py | 2 +- libmproxy/dump.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 1096f04cb..bad73e91a 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -649,7 +649,7 @@ class ConsoleMaster(flow.FlowMaster): self.state.last_saveload = path path = os.path.expanduser(path) try: - f = file(path, "r") + f = file(path, "rb") fr = flow.FlowReader(f) except IOError, v: return v.strerror diff --git a/libmproxy/dump.py b/libmproxy/dump.py index 1f90184ba..9ad6c3272 100644 --- a/libmproxy/dump.py +++ b/libmproxy/dump.py @@ -121,7 +121,7 @@ class DumpMaster(flow.FlowMaster): if options.rfile: path = os.path.expanduser(options.rfile) try: - f = file(path, "r") + f = file(path, "rb") freader = flow.FlowReader(f) except IOError, v: raise DumpError(v.strerror)