webrowser and linux (also os.execv)

T

Tim Newsham

On redhat8 with Python 2.3.4:

import webbrowser
webbrowser.open("http://www.google.com/")

opens a browser (if not yet open) but fails to redirect it. Another
window of mine receives an error message:

channel 4: open failed: connect failed: Connection refused

The browser is the stock Mozilla browser that came with the
system. The same command works flawlessly under windows.

Any idea where the problem lies? I would like to get this
working in short order if possible (I can rebuild the python
package if necessary).



Oh, on an unrelated note, the os.execv and os.execve functions
do not allow an empty argv to be passed in, even though the
underlying C/Unix primitives do. Although it is rare that
one would want to pass in an empty argv (with argc set to zero)
there are rare situations when this is desired. The fact
that python tries to protect the user from making a mistake
by limiting the flexibility of the API is a deficiency.

Tim N.
 
T

Tim Newsham

import webbrowser
webbrowser.open("http://www.google.com/")
opens a browser (if not yet open) but fails to redirect it. Another
window of mine receives an error message:

Oh man, I feel dumb, please ignore this question. I figured
it out and its unrelated to python.

Tim N.
 
D

Donn Cave

Tim Newsham said:
Oh, on an unrelated note, the os.execv and os.execve functions
do not allow an empty argv to be passed in, even though the
underlying C/Unix primitives do. Although it is rare that
one would want to pass in an empty argv (with argc set to zero)
there are rare situations when this is desired. The fact
that python tries to protect the user from making a mistake
by limiting the flexibility of the API is a deficiency.

On MacOS X, non-empty is a documented requirement for execve
and its C library wrappers like execv, and an attempt to use
an empty argv causes a `bus error'. Very likely the same on
other Berkeley implementations. I also have a hard time
imagining even a rare situation where it would make sense.

Donn Cave, (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top