Detect local files correctly

This commit is contained in:
Florian Bruhin 2014-05-06 20:24:53 +02:00
parent 4a7ccbf131
commit 077d3be2e0

View File

@ -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))