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: webbrowser.open hangs under certain conditions
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, nnorwitz, sjoerd
Priority: normal Keywords:

Created on 2003-10-02 21:00 by sjoerd, last changed 2022-04-10 16:11 by admin. This issue is now closed.

Messages (2)
msg18521 - (view) Author: Sjoerd Mullender (sjoerd) * (Python committer) Date: 2003-10-02 21:00
On Unix, if you have galeon installed and no BROWSER
environment variable, webbrowser.open('http://...')
will hang if there is no galeon running at the time of
the call.

The problem is, webbrowser.open calls "galeon <the
URL>".  If a galeon instance is running, the new
invocation will signal the old about the URL and then
exit.  If there is no galeon instance running, the new
instance will do the job itself and not exit, so the
call to webbrowser.open() will hang until you exit galeon.

Skip had this to say:

In the meantime, it looks like if you modify the
definition of cmd in
Galeon._remote to 

        cmd = "%s %s %s & >/dev/null 2>&1" %
(self.name, raise_opt, action)

that webbrowser.open() should return for you.  I'm not
sure the '&' is sufficient though.  You may lose the
Galeon instance if you then exit from the Python
interpreter.  In general, the code in
webbrowser._remote() looks a bit hackish.  I'm not sure
I like this:

        rc = os.system(cmd)
        if rc:
            import time
            os.system("%s >/dev/null 2>&1 &" % self.name)
            time.sleep(PROCESS_CREATION_DELAY)
            rc = os.system(cmd)

Oh well, it's what we're stuck with...

msg18522 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2005-12-19 03:39
Logged In: YES 
user_id=33168

webbrowser was pretty much re-written, so I'm assuming this
is at least out of date, and hopefully fixed.
History
Date User Action Args
2022-04-10 16:11:34adminsetgithub: 39357
2003-10-02 21:00:18sjoerdcreate