Use fully encoded url for xdg-open

This commit is contained in:
Kovid Goyal 2023-11-25 10:47:10 +05:30
parent 0fc95de045
commit 4d45b5a6f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)