[Python-Dev] weird webbrowser behavior

Skip Montanaro skip@pobox.com (Skip Montanaro)
Thu, 31 May 2001 14:57:21 -0500


I'm using Gnome under Mandrake 8.0 and getting very strange results using
webbrowser (indirectly via pydoc).  Apparently, Gnome's init code sets the
BROWSER environment variable to "nautilus" (much to my surprise) and
webbrowser trusts it as the god's honest truth, even though nautilus has not
been registered with the webbrowser module (am I supposed to add that sort
of stuff to site.py?).  Accordingly, _tryorder is ['nautilus'] but doesn't
appear in _browser.keys() is ['lynx', 'links', 'netscape', 'kfm',
'mozilla'].  I think webbrowser should either ignore elements of BROWSER if
they have not previously been registered (and can't be found by _iscommand)
or try to register them using GenericBrowser.  Users are apparently not the
only people setting BROWSER, so the comment in the code:

    # It's the user's responsibility to register handlers for any unknown
    # browser referenced by this value, before calling open().

seems like flawed logic to me.

Skip