From 422386492149b149cd1708f419628aeed17f7ee7 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Mon, 2 Aug 2021 11:25:08 +0200 Subject: [PATCH] inql.actions.browser: fix the Windows file opener Windows file opener needs path normalization to open the url. Pass each and every path to File.toURI to create an always valid file URI. Fixes #40 --- inql/actions/browser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inql/actions/browser.py b/inql/actions/browser.py index c210848..0928071 100644 --- a/inql/actions/browser.py +++ b/inql/actions/browser.py @@ -11,7 +11,7 @@ from java.awt import Desktop from javax.swing import JMenuItem from java.net import URI - +from java.io import File as JavaFile class URLOpener(): """ @@ -58,7 +58,7 @@ def actionPerformed(self, e): :param e: unused :return: """ - URLOpener().open("file://%s" % self.target) + URLOpener().open(JavaFile(self.target).toURI().toString()) def ctx(self, host=None, payload=None, fname=None): """