webbrowser.open always opens up Safari on Lion
anknguyen at gmail.com
Sun Feb 26 04:38:25 CET 2012
If Safari is your default browser, Python will open the address in Safari.
>From the Python docs:
webbrowser.open(url[, new=0[, autoraise=True]])
Display url using the default browser. If new is 0, the url is opened in
the same browser window if possible. If new is 1, a new browser window is
opened if possible. If new is 2, a new browser page (“tab”) is opened if
possible. If autoraise is True, the window is raised if possible (note that
under many window managers this will occur regardless of the setting of
Note that on some platforms, trying to open a filename using this function,
may work and start the operating system’s associated program. However, this
is neither supported nor portable.
On Sat, Feb 25, 2012 at 8:33 PM, Leo <sdl.web at gmail.com> wrote:
> On Lion and with its stock python version 2.7.1 r271:86832,
> webbrowser.open('file://localhost/nonexistingfile') always opens up
> Safari. Is this a bug?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list