From 05db6e32c7957f267e97c34aa8f5a3cd6cb7dbb2 Mon Sep 17 00:00:00 2001 From: Matt Weidner Date: Fri, 21 Jul 2017 16:25:16 -0500 Subject: [PATCH] Added support for the ~ path shortcut when loading flows from disk. for consistency. Saving flows supports using paths with the ~ shortcut. --- mitmproxy/addons/view.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mitmproxy/addons/view.py b/mitmproxy/addons/view.py index 0c8d0b175..b2db01711 100644 --- a/mitmproxy/addons/view.py +++ b/mitmproxy/addons/view.py @@ -10,6 +10,7 @@ The View: """ import collections import typing +import os import blinker import sortedcontainers @@ -339,6 +340,7 @@ class View(collections.Sequence): """ Load flows into the view, without processing them with addons. """ + path = os.path.expanduser(path) try: with open(path, "rb") as f: for i in io.FlowReader(f).stream():