From 2fe7e22bf83070920c206b427597d817877b28a2 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Thu, 4 Mar 2021 23:25:53 +0000 Subject: [PATCH] CLI: Tidy up single_location handling --- volatility3/cli/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/volatility3/cli/__init__.py b/volatility3/cli/__init__.py index 9988022bc..ef9965872 100644 --- a/volatility3/cli/__init__.py +++ b/volatility3/cli/__init__.py @@ -273,7 +273,8 @@ class CommandLine: single_location = urllib.parse.urlparse(args.file, 'file') if single_location.scheme == 'file' or len(single_location.scheme) == 1: # Otherwise construct a URL parameter - single_location = urllib.parse.urlparse(urllib.parse.urljoin('file:', request.pathname2url(os.path.abspath(args.file)))) + file_path = request.pathname2url(os.path.abspath(args.file)) + single_location = urllib.parse.urlparse(urllib.parse.urljoin('file:', file_path)) if not os.path.exists(single_location.path): parser.error("File does not exist: {}".format(single_location.path)) ctx.config['automagic.LayerStacker.single_location'] = urllib.parse.urlunparse(single_location)