This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: webbrowser priorities
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, luks
Priority: normal Keywords:

Created on 2007-03-15 08:03 by luks, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
webbrowser-defaults.diff luks, 2007-03-15 11:47
Messages (5)
msg31521 - (view) Author: Lukas Lalinsky (luks) Date: 2007-03-15 08:03
Recently I've run into a Windows-specific bug in webbrowser (using close_fds and preexec_fn in subprocess.Popen), and I noticed there are some strange priorities in the default browsers.

For example:
 * Why is firefox, firebird, seamonkey, mozilla, netscape and opera preferred over the *user's* preferred browser on Windows?
 * Why is the GNOME default browser preferred even if the user is currently running KDE (but has GNOME installed)?

From all the platforms, only on Mac OS X it really respects the user's preferrencies.

I'd like to propose this:
 * On Windows, make "windows-default" the first in _try_order
 * If the user is running GNOME ("GNOME_DESKTOP_SESSION_ID" in os.environ) and command "gnome-open" exists, use `gnome-open '%s'`.
 * If the user is running KDE (os.environ.get("KDE_FULL_SESSION") == "true") and command "kfmclient" exists, use `kfmclient exec '%s'`.
msg31522 - (view) Author: Lukas Lalinsky (luks) Date: 2007-03-15 08:06
Just a note, if you agree with this behavior, I'll be more than happy to make a patch. Currently I'm using similar mechanism in my own code (because Python's lib in 2.4 doesn't respect GNOME/KDE settings at all), so I can easily turn it into a patch.
msg31523 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-15 08:50
I agree with your suggestion. Can you make a patch (and include a fix for the other bug you filed)?
msg31524 - (view) Author: Lukas Lalinsky (luks) Date: 2007-03-15 11:47
Ok, here is the patch, including the fix for #1681248. The priorities on all platforms with this patch are:

1. The BROWSER environment variable overrides everything
2. Next step is to check the preferred browsers for desktop environments (Windows, Mac OS X, GNOME and KDE)
3. Fallback to available installed browsers (firefox, opera, konqueror, epiphany, ...)

File Added: webbrowser-defaults.diff
msg31525 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-03-16 07:55
Committed in rev. 54406.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44721
2007-03-15 08:03:06lukscreate