details: https://code.tryton.org/tryton/commit/f784af002b09
branch: default
user: Cédric Krier <[email protected]>
date: Wed Oct 07 14:02:30 2026 +0200
description:
Test the return of the call to Gio.AppInfo.launch_default_for_uri call
Closes #15153
diffstat:
tryton/tryton/common/common.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r 3e8f44469c15 -r f784af002b09 tryton/tryton/common/common.py
--- a/tryton/tryton/common/common.py Wed Oct 28 13:31:52 2026 +0100
+++ b/tryton/tryton/common/common.py Wed Oct 07 14:02:30 2026 +0200
@@ -660,15 +660,19 @@
else:
uri = GLib.filename_to_uri(filename)
try:
- Gio.AppInfo.launch_default_for_uri(uri)
+ result = Gio.AppInfo.launch_default_for_uri(uri)
except GLib.Error:
+ result = False
+ if not result:
save()
def webbrowser_open(url):
try:
- Gio.AppInfo.launch_default_for_uri(url)
+ result = Gio.AppInfo.launch_default_for_uri(url)
except GLib.Error:
+ result = False
+ if not result:
webbrowser.open(url)