I really need webbrowser.open('file://') to open a web browser

Timur Tabi timur at freescale.com
Fri Jan 15 15:14:57 EST 2010


After reading several web pages and mailing list threads, I've learned
that the webbrowser module does not really support opening local
files, even if I use a file:// URL designator.  In most cases,
webbrowser.open() will indeed open the default web browser, but with
Python 2.6 on my Fedora 10 system, it opens a text editor instead.  On
Python 2.5, it opens the default web browser.

This is a problem because my Python script creates a local HTML file
and I want it displayed on the web browser.

So is there any way to force webbrowser.open() to always use an actual
web browser?

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the Python-list mailing list