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.

classification
Title: Replacement for webbrowser.py which has problems.
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, georg.brandl, mfranklin1, phd, rodsenra, vdbergh
Priority: normal Keywords: patch

Created on 2004-05-15 22:02 by vdbergh, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
webbrowser.py vdbergh, 2004-05-15 22:02 New version of webbrowser.py (from CVS 5/15/2004)
webbrowser.py vdbergh, 2004-05-16 07:50 Previous version did not work on windows!
Messages (5)
msg45974 - (view) Author: Michel Van den Bergh (vdbergh) Date: 2004-05-15 22:02
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.

msg45975 - (view) Author: Martin Franklin (mfranklin1) Date: 2004-11-11 10:05
Logged In: YES 
user_id=482545



Great work... couple of points I just tested on my fedora c2
box (with firefox & opera installed...)  The try order did
not include firefox.  

Also I believe (at least on my system) opera can be treated
just like the 
netscape browsers, it supports the same command line flags.

As to the tryorder *I* would personally have firefox up
front because if you 
have it installed the chances are you want to use it instead
of mozzilla (same 
goes for opera)
msg45976 - (view) Author: Oleg Broytman (phd) * Date: 2005-03-19 20:48
Logged In: YES 
user_id=4799

IWBN to have exactly one patch (I do not understand which
one of those two is THE patch) in "context diff" format.
Please delete the attachments and resubmit the patch.

The idea of running "-remote" and then starting the program
if it hadn't been started is fine!

Why to add "-iconic" for Netscape if not autoraise? "Not
autoraise" means "do not change z-order of the window" but
that does not neccessary implies "leave the window iconic"
even less "make the window iconic". When you run a new
program "not autoraise" should be ignore, as far as I
understand.
msg45977 - (view) Author: Rodrigo Dias Arruda Senra (rodsenra) Date: 2005-03-20 01:26
Logged In: YES 
user_id=9057


There is no patch attached, but the whole file was uploaded.
Twice!
There is already a comment by Oleg Broytmann telling the person 
to re-submit it in as a proper patch.

There are multiple changes in it, perhaps multiples patches.
Each addresing a single change. Some of the proposed changes
are declared untested.

Some changes might be controversial, like using a new
environment variable PYTHONBROWSER prior to checking
BROWSER.  There are no references to this being discussed in
python-dev.

I recommend closing 954628.
msg45978 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-09-15 07:58
Logged In: YES 
user_id=1188172

Subsumed by #754022.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40259
2004-05-15 22:02:41vdberghcreate