From 062563a562d7c4a698ae7560db83f23048133775 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 15 Feb 2019 09:59:54 +0530 Subject: [PATCH] icat: Add support for file:// URLs as well --- kittens/icat/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kittens/icat/main.py b/kittens/icat/main.py index 5bc133cc9..78fbd5865 100755 --- a/kittens/icat/main.py +++ b/kittens/icat/main.py @@ -339,6 +339,16 @@ def main(args=sys.argv): item = tf.name is_tempfile = True process(item, args, is_tempfile) + elif item.lower().startswith('file://'): + from urllib.parse import urlparse + from urllib.request import url2pathname + item = urlparse(item) + if os.sep == '\\': + item = item.netloc + item.path + else: + item = item.path + item = url2pathname(item) + process(item, args, is_tempfile) else: if os.path.isdir(item): for x in scan(item):