[Python-bugs-list] [ python-Bugs-605109 ] webbrowser.open() fails on Linux

noreply@sourceforge.net noreply@sourceforge.net
Fri, 06 Sep 2002 04:39:15 -0700


Bugs item #605109, was opened at 2002-09-05 15:37
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=605109&group_id=5470

Category: Extension Modules
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Hein (dthein)
Assigned to: Nobody/Anonymous (nobody)
Summary: webbrowser.open() fails on Linux

Initial Comment:
webbrowser.open( "http://www.python.org" ) just launches 
the browser, but without the URL.  In other words, the 
default ("home") page of the browser opens, rather than the 
URL specified in the call.

This fails on Linux.  Function works on Win32.

I'm using Python 2.2.1, Tk/Tcl 8.4b2, Linux 2.4.9.

Web browser is Mozilla 1.0RC3.  



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

>Comment By: Dave Hein (dthein)
Date: 2002-09-06 11:39

Message:
Logged In: YES 
user_id=603528

OK, now that I see the command, I found the problem.  I had
a shell script, "mozilla", in the path that was only taking
one argument.

(I used this script to invoke mozilla from the command line
so that I could easily switch between various test versions)

I modified the script to pass in up to 5 arguments.  Now
webbrowser.open() works as expected.

Thanks for the quick follow-up!  Sorry for the "user error" bug.

This bug can be closed.


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

Comment By: Dave Hein (dthein)
Date: 2002-09-06 11:27

Message:
Logged In: YES 
user_id=603528

Here is the log of my test:

[quote]
Python 2.2.1 (#3, Sep  1 2002, 15:04:10) 
[GCC 3.2] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import webbrowser
>>> webbrowser.open( "http://www.sf.net" )
cmd: "mozilla -raise -remote 'openURL(http://www.sf.net)'
>/dev/null 2>&1"
rc: 0
>>> 
[end quote]

For completeness, here is the chunk of code with the
additional print statements (with [TB] to indicate leading
tabs since these postings destroy whitespace):

[TB]print "cmd: \" + cmd + "\" #DEBUG
[TB]rc = os.system(cmd)
[TB]print "rc: " + `rc`  #DEBUG
[TB]if rc:
[TB][TB]import time
[TB][TB]os.system("%s &" % self.name)
[TB][TB]time.sleep(PROCESS_CREATION_DELAY)
[TB][TB]print "before os.system(cmd)" #DEBUG
[TB][TB]rc = os.system(cmd)
[TB][TB]print "after os.system(cmd)" #DEBUG
[TB]return not rc


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

Comment By: Martin v. Löwis (loewis)
Date: 2002-09-06 09:49

Message:
Logged In: YES 
user_id=21627

Can you please edit webbrowser.Netscape._remote, to add

print cmd

before

rc = os.system(cmd)

Can you also add a print statement into the 'if rc' block?
Can you then please report the output of these print statements?

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

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