Issue 1624674: webbrowser.open_new() suggestion - Python tracker (original) (raw)

Hello,

under Linux if I use webbrowser.open_new('...') a konqueror gets invoked. At the time when invoking konqueror (maybe you probe first, but anyways) you assume that user has a properly installed kde. But if you assume the user has a properly installed KDE you have a better opportunity to open a webpage, even in the browser preferred by the user -- no matter really what it is. Try this one: kfmclient exec http://sourceforge.net/ using this one the client associated with .html in kcontrol gets invoked. I suppose that (becouse of the ability to customize the browser) this way would be better if available than guessing which browser would the user prefer.

A quick look at the code makes me think that it does try to run kfmclient first. Specifically, line 351 of webbrowser.py tries kfmclient, while like line 363 of webbrowser.py opens konqueror.

I don't really run KDE, Gnome, or Windows, so I'm not a lot of help for testing this for you. I can, however, tell you that it does the "right thing" for me, in that it opens Firefox. When I did Python development on Windows, it also "did the right thing" there.