]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417)
authorSimon McVittie <smcv@debian.org>
Wed, 5 Jan 2022 11:53:23 +0000 (11:53 +0000)
committerGitHub <noreply@github.com>
Wed, 5 Jan 2022 11:53:23 +0000 (11:53 +0000)
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@debian.org>
Lib/webbrowser.py

index 02d2036906178fa943dc98bb351bd3b479c1125b..44974d433b46966d98cd3cc9d5dcb22d60b0feed 100755 (executable)
@@ -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"))