[Python-checkins] bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417)

pablogsal webhook-mailer at python.org
Wed Jan 5 06:53:31 EST 2022


https://github.com/python/cpython/commit/dd50316e458d7c3284f8948b0606d8aa91ab855d
commit: dd50316e458d7c3284f8948b0606d8aa91ab855d
branch: main
author: Simon McVittie <smcv at debian.org>
committer: pablogsal <Pablogsal at gmail.com>
date: 2022-01-05T11:53:23Z
summary:

bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417)

gvfs-open was deprecated in 2015 and removed in 2018, but its replacement,
gio(1), is not available in Ubuntu 16.04, which is apparently still
supported by CPython upstream even though it is considered to be EOL by
Ubuntu developers.

Signed-off-by: Simon McVittie <smcv at debian.org>

files:
M Lib/webbrowser.py

diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 02d2036906178..44974d433b469 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -467,6 +467,10 @@ def register_X_browsers():
     if shutil.which("gio"):
         register("gio", None, BackgroundBrowser(["gio", "open", "--", "%s"]))
 
+    # Equivalent of gio open before 2015
+    if "GNOME_DESKTOP_SESSION_ID" in os.environ and shutil.which("gvfs-open"):
+        register("gvfs-open", None, BackgroundBrowser("gvfs-open"))
+
     # The default KDE browser
     if "KDE_FULL_SESSION" in os.environ and shutil.which("kfmclient"):
         register("kfmclient", Konqueror, Konqueror("kfmclient"))



More information about the Python-checkins mailing list