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.

Title: Pydoc can't find browser (bug+solution!)
Type: Stage:
Components: Library (Lib) Versions: Python 2.6, Python 2.5
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, georg.brandl, midtoad
Priority: low Keywords:

Created on 2004-12-09 05:14 by midtoad, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit midtoad, 2004-12-09 05:14 patched for pydoc
Messages (3)
msg23616 - (view) Author: Stewart Midwinter (midtoad) Date: 2004-12-09 05:14
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/", line 1345, in 
    return self.func(*args) 
  File "/usr/lib/python2.3/", line 1970, in open 
  File "/usr/lib/python2.3/", line 43, in 
    get().open(url, new, autoraise) 
  File "/usr/lib/python2.3/", 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 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 
if os.environ.has_key("BROWSER") and \ 
   os.environ["BROWSER"]=='kfmclient openProfile 
    os.environ["BROWSER"] = 'konqueror' # set it to 
msg23617 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-08-03 20:55
Logged In: YES 

Or perhaps should execute the command using
os.system() or some similar mechanism that would split on
the whitespace and treat the additional arguments correctly.
msg61436 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-01-21 18:39
This should be fixed in 2.5's
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41301
2008-01-21 18:39:33georg.brandlsetstatus: open -> closed
nosy: + georg.brandl
resolution: out of date
messages: + msg61436
2008-01-04 00:43:06christian.heimessetpriority: normal -> low
versions: + Python 2.6, Python 2.5, - Python 2.3
2004-12-09 05:14:07midtoadcreate