[Patches] [ python-Patches-954628 ] Replacement for webbrowser.py which has problems.

SourceForge.net noreply at sourceforge.net
Sat May 15 18:02:41 EDT 2004


Patches item #954628, was opened at 2004-05-15 22:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=954628&group_id=5470

Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Michel Van den Bergh (vdbergh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Replacement for webbrowser.py which has problems.

Initial Comment:
I have been checking out webbrowser.py. Unfortunately
this module has some obvious problems (tested on CVS
version under Linux with mozilla)

(*) If you open an url (with the option "new window")
and the browser is not already running then it opens
*two* windows: the home page and your url. This is
different for example from the default behaviour on
Windows and also quite ugly.

(**) There is another related problem: if you open a
url and the browser is not already running then the
code starts a new browser, sleeps 4 seconds and then
issues a "-remote" command.

Using a timed sleep is very bad programming and
*extremely fragile*. Indeed I had failures because the
delay (PROCESS_CREATION_DELAY) was not long enough. At
the very least the -remote command should be tried a
couple of times.

BUT: there is no reason *at all* to issue a -remote
command in this case. All browsers I know accept a url
as argument. So one can just start a new browser with
the url as argument.

There are two pending patches for webbrowser.py but
they don't address the above problems. Therefore I made
a new version of webbrowser.py (from the latest CVS)
that addresses them.

Along the way I made a few other non-intrusive changes.
They are listed below.

Added PYTHONBROWSER environment variable since Mandrake
10.0
already sets BROWSER.

Added opera, epiphany,firefox,firebird. Firebird and
firefox and the rewritten code for Galeon are not tested

Changed default on windows to be "startfile" (instead
of Netscape).

Changed _tryorder on X into something more reasonable
for these days.



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

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



More information about the Patches mailing list