From fc7488645f89b0ccb37f032dc2d41063ed9fee20 Mon Sep 17 00:00:00 2001 From: meles5 Date: Fri, 25 Sep 2015 18:21:04 +0200 Subject: [PATCH] The resource_url() function should now support Windows --- qutebrowser/utils/jinja.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qutebrowser/utils/jinja.py b/qutebrowser/utils/jinja.py index 54365d542..e09cd0324 100644 --- a/qutebrowser/utils/jinja.py +++ b/qutebrowser/utils/jinja.py @@ -19,6 +19,7 @@ """Utilities related to jinja2.""" +import os import os.path import jinja2 @@ -62,6 +63,11 @@ def _guess_autoescape(template_name): def resource_url(path): + # If Windows is the operating system, replace slashes with backslashes + if os.name == "nt": + path = path.replace("/", os.sep) + path = path[-1:] + image = utils.resource_filename(path) return QUrl.fromLocalFile(image).toString(QUrl.FullyEncoded)