Strip url before trying to open it as a path
This commit is contained in:
parent
364d069e74
commit
6327d0fe36
@ -168,6 +168,7 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True):
|
|||||||
Return:
|
Return:
|
||||||
A target QUrl to a search page or the original URL.
|
A target QUrl to a search page or the original URL.
|
||||||
"""
|
"""
|
||||||
|
urlstr = urlstr.strip()
|
||||||
expanded = os.path.expanduser(urlstr)
|
expanded = os.path.expanduser(urlstr)
|
||||||
if os.path.isabs(expanded):
|
if os.path.isabs(expanded):
|
||||||
path = expanded
|
path = expanded
|
||||||
@ -181,7 +182,6 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True):
|
|||||||
else:
|
else:
|
||||||
path = None
|
path = None
|
||||||
|
|
||||||
stripped = urlstr.strip()
|
|
||||||
if path is not None and os.path.exists(path):
|
if path is not None and os.path.exists(path):
|
||||||
log.url.debug("URL is a local file")
|
log.url.debug("URL is a local file")
|
||||||
url = QUrl.fromLocalFile(path)
|
url = QUrl.fromLocalFile(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user