From 4d45b5a6f57461dcff1e56474a4dccc4fe8748d2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 25 Nov 2023 10:47:10 +0530 Subject: [PATCH] Use fully encoded url for xdg-open --- src/calibre/gui2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index c2e878e2d2..cce168e597 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -1470,7 +1470,7 @@ def open_url(qurl): print('QDesktopServices::openUrl() failed for url:', qurl, file=sys.stderr) if islinux: import subprocess - cmd = ['xdg-open', qurl.toLocalFile() if qurl.isLocalFile() else qurl.toString()] + cmd = ['xdg-open', qurl.toLocalFile() if qurl.isLocalFile() else qurl.toString(QUrl.ComponentFormattingOption.FullyEncoded)] if DEBUG: print('Running opener:', cmd) subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)