[spambayes-dev] Setting up a new account

Skip Montanaro skip at pobox.com
Thu Oct 2 15:59:48 EDT 2003


    Sjoerd> This was on RedHat with the Gnome desktop.  It started galeon,
    Sjoerd> and since I didn't have a galeon running at the time, the one
    Sjoerd> just invoked didn't return.  Normally if you have a galeon
    Sjoerd> browser running, a new one will just signal the old one and
    Sjoerd> exit.

So if you don't already have Galeon running and you execute

    import webbrowser
    webbrowser.open("http://www.python.org/")

at the Python prompt, you don't get the next prompt until after you've
exited Galeon?  This is a webbrowser module bug (or a Galeon bug which the
webbrowser module fails to worm around).  Can you file a bug report on the
Python project?

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...

Thx,

Skip




More information about the spambayes-dev mailing list