From 6327d0fe36ccefe2f0958d148d25d0f0e18c0c18 Mon Sep 17 00:00:00 2001 From: Tarcisio Fedrizzi Date: Sat, 9 Jan 2016 11:26:17 +0100 Subject: [PATCH] Strip url before trying to open it as a path --- qutebrowser/utils/urlutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index 307ade709..fb1771d12 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -168,6 +168,7 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True): Return: A target QUrl to a search page or the original URL. """ + urlstr = urlstr.strip() expanded = os.path.expanduser(urlstr) if os.path.isabs(expanded): path = expanded @@ -181,7 +182,6 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True): else: path = None - stripped = urlstr.strip() if path is not None and os.path.exists(path): log.url.debug("URL is a local file") url = QUrl.fromLocalFile(path)