mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
Merge pull request #54 from mhils/fix_r_option
fix -r option, read file in binary mode
This commit is contained in:
commit
a5bf9d3eb3
@ -649,7 +649,7 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
self.state.last_saveload = path
|
self.state.last_saveload = path
|
||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
try:
|
try:
|
||||||
f = file(path, "r")
|
f = file(path, "rb")
|
||||||
fr = flow.FlowReader(f)
|
fr = flow.FlowReader(f)
|
||||||
except IOError, v:
|
except IOError, v:
|
||||||
return v.strerror
|
return v.strerror
|
||||||
|
@ -121,7 +121,7 @@ class DumpMaster(flow.FlowMaster):
|
|||||||
if options.rfile:
|
if options.rfile:
|
||||||
path = os.path.expanduser(options.rfile)
|
path = os.path.expanduser(options.rfile)
|
||||||
try:
|
try:
|
||||||
f = file(path, "r")
|
f = file(path, "rb")
|
||||||
freader = flow.FlowReader(f)
|
freader = flow.FlowReader(f)
|
||||||
except IOError, v:
|
except IOError, v:
|
||||||
raise DumpError(v.strerror)
|
raise DumpError(v.strerror)
|
||||||
|
Loading…
Reference in New Issue
Block a user