Skip to content

Commit

Permalink
inql.actions.browser: fix the Windows file opener
Browse files Browse the repository at this point in the history
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
  • Loading branch information
thypon committed Aug 2, 2021
1 parent 0cd8a55 commit 4223864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inql/actions/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 4223864

Please sign in to comment.