Skip to content

Commit

Permalink
Url-quote norm_path and use urljoin to attach the scheme.
Browse files Browse the repository at this point in the history
Assumes that if the path is already a URI it is also already quoted.

Fixes #13218, #13197
  • Loading branch information
jralls authored and Nick-Hall committed May 4, 2024
1 parent 51205e5 commit aaa6b68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gramps/gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import os
import sys
import threading
from urllib.parse import urljoin, quote as urlquote

# gtk is not included here, because this file is currently imported
# by code that needs to run without the DISPLAY variable (eg, in
Expand Down Expand Up @@ -506,7 +507,8 @@ def open_file_with_default_application(path, uistate):
return

if not norm_path.startswith("file://"):
norm_path = "file://" + norm_path
norm_path = urljoin("file://", urlquote(norm_path))

try:
Gio.AppInfo.launch_default_for_uri(norm_path)
except GLib.Error as error:
Expand Down

0 comments on commit aaa6b68

Please sign in to comment.