details: https://code.tryton.org/tryton/commit/71b9fc3291c0
branch: 7.8
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
(grafted from f784af002b0991561c04933e2c30bea22c7ca644)
diffstat:
tryton/tryton/common/common.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r 99d36e30fcea -r 71b9fc3291c0 tryton/tryton/common/common.py
--- a/tryton/tryton/common/common.py Wed Oct 28 13:24:04 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)