From 96eff656903787e7218e84ce931d9b75560d51c7 Mon Sep 17 00:00:00 2001 From: Christopher Pezley Date: Sun, 22 Oct 2017 18:41:29 +0200 Subject: [PATCH] Log when url contains characters not present in current locale. --- qutebrowser/utils/urlutils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index dff1ef8f1..e8dea98ae 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -373,15 +373,14 @@ def get_path_if_valid(pathstr, cwd=None, relative=False, check_exists=False): if check_exists: if path is not None: - # If the path contains characters that the locale cannot handle, - # then we consider it as non-existent. try: if os.path.exists(path): log.url.debug("URL is a local file") except UnicodeEncodeError: + log.url.debug( + "URL contains characters which are not present in the " \ + "current locale") path = None - else: - path = None return path