webbrowser module's Firefox support

Dustan DustanGroups at gmail.com
Sun Sep 24 00:10:10 CEST 2006

At http://docs.python.org/whatsnew/modules.html on the webbrowser
module, it says "A number of additional browsers were added to the
supported list such as Firefox, Opera, Konqueror, and elinks."

I just installed python 2.5, looking forward to being able to control
firefox without having to make it my default browser, but...

I don't seem to have that functionality. In IDLE:

>>> import webbrowser
>>> webbrowser._browsers
{'windows-default': [<class 'webbrowser.WindowsDefault'>, None]}

So I tried to track down what the problem might be, seeing as I also
have Netscape installed on my system (Windows XP), and it's not showing
up either. I found where the code appears to test that the system has
firefox installed, and found it calls _iscommand; here's what I get
running similar code:

>>> import os
>>> path = os.environ.get("PATH")
>>> for d in path.split(os.pathsep):
	print d

C:\Program Files\PC-Doctor for Windows\services
C:\Program Files\Hummingbird\Connectivity\7.10\Accessories\

The path for firefox is "C:\Program Files\Mozilla Firefox\firefox.exe".

Ok, now I'm at a roadblock; I have no idea where to go from here.

I did do a search here, but came up empty-handed. Can anyone tell me
how to get the webbrowser module to recognize firefox's existence,
given this information?

More information about the Python-list mailing list