From 077d3be2e0dca6108f3839fdc60c7d30e9da7d4b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 May 2014 20:24:53 +0200 Subject: [PATCH] Detect local files correctly --- qutebrowser/utils/url.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/utils/url.py b/qutebrowser/utils/url.py index 3e73c557c..e29c270ad 100644 --- a/qutebrowser/utils/url.py +++ b/qutebrowser/utils/url.py @@ -18,6 +18,7 @@ """Utils regarding URL handling.""" import re +import os.path import logging import urllib.parse @@ -193,6 +194,9 @@ def is_url(url): # Special URLs are always URLs, even with autosearch=False logging.debug("Is an special URL.") return True + elif os.path.exists(url): + # local file + return True elif autosearch == 'dns': logging.debug("Checking via DNS") return _is_url_dns(QUrl.fromUserInput(urlstr))