From 5e01ab811bc3b1cc8b0df5d311159f4a5bf7069f Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 7 Mar 2021 13:08:48 +0000 Subject: [PATCH] CLI: Improve URI handling error for windows --- volatility3/cli/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/volatility3/cli/__init__.py b/volatility3/cli/__init__.py index b5e6f9721..07cd57955 100644 --- a/volatility3/cli/__init__.py +++ b/volatility3/cli/__init__.py @@ -344,7 +344,10 @@ class CommandLine: urllib.parse.urljoin('file:', urllib.request.pathname2url(os.path.abspath(filename)))) if single_location.scheme == 'file': if not os.path.exists(urllib.request.url2pathname(single_location.path)): - raise ValueError("File does not exist: {}".format(urllib.request.url2pathname(single_location.path))) + filename = urllib.request.url2pathname(single_location.path) + if not filename: + raise ValueError("File URL looks incorrect (potentially missing /)") + raise ValueError("File does not exist: {}".format(filename)) return urllib.parse.urlunparse(single_location) def process_exceptions(self, excp):