[ python-Bugs-1081879 ] Pydoc can't find browser (bug+solution!)

SourceForge.net noreply at sourceforge.net
Thu Aug 3 22:55:57 CEST 2006


Bugs item #1081879, was opened at 2004-12-09 00:14
Message generated for change (Comment added) made by akuchling
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1081879&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Stewart Midwinter (midtoad)
Assigned to: Nobody/Anonymous (nobody)
Summary: Pydoc can't find browser (bug+solution!)

Initial Comment:
I've got Python 2.3 installed on Mandrake Linux 10.1 with 
KDE 3.2 running.  When I run "pydoc -g" and search on 
any term, if I try to display the relevant documentation, 
pydoc throws an exception: 
 
Traceback (most recent call last): 
  File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in 
__call__ 
    return self.func(*args) 
  File "/usr/lib/python2.3/pydoc.py", line 1970, in open 
    webbrowser.open(url) 
  File "/usr/lib/python2.3/webbrowser.py", line 43, in 
open 
    get().open(url, new, autoraise) 
  File "/usr/lib/python2.3/webbrowser.py", line 38, in get 
    raise Error("could not locate runnable browser") 
Error: could not locate runnable browser 
 
I did some research and found that the problem is that 
KDE sets the BROWSER environment variable to an 
unexpected value: 
BROWSER='kfmclient openProfile webbrowsing' 
 
The solution would be to test for this strange setting. I 
patched webbrowser.py on my system in an inelegant 
fashion by simply inserting the following code at the top 
of the file, just after the 'import' statements: 
 
#patch for KDE mangling of BROWSER environment 
variable 
#per: 
http://mail.python.org/pipermail/tutor/2004-September/032060.html 
 
if os.environ.has_key("BROWSER") and \ 
   os.environ["BROWSER"]=='kfmclient openProfile 
webbrowsing': 
    os.environ["BROWSER"] = 'konqueror' # set it to 
konqueror 
 
 
 

----------------------------------------------------------------------

>Comment By: A.M. Kuchling (akuchling)
Date: 2006-08-03 16:55

Message:
Logged In: YES 
user_id=11375

Or perhaps webbrowser.py should execute the command using
os.system() or some similar mechanism that would split on
the whitespace and treat the additional arguments correctly.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1081879&group_id=5470


More information about the Python-bugs-list mailing list