469,600 Members | 2,211 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

os.startfile / webbrowser + Firefox

Hi,

os.startfile('http://www.python.org') works fine on WinXP with IE as
default webbrowser. With Mozilla Firefox 0.9 as default webbrowser,
however, I get an error. Firefox starts, the page gets loaded and then
Python gives me an error message (Traceback below). The same is true
for the webbowser module. Is this a Python problem or a Firefox
problem?

Matthias

import os
os.startfile('http://www.python.org')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
os.startfile('http://www.python.org')
WindowsError: [Errno 2] Das System kann die angegebene Datei
nicht finden: 'http://www.python.org'
import webbrowser
webbrowser.open('http://www.python.org')
Traceback (most recent call last):
File "<pyshell#4>", line 1, in -toplevel-
webbrowser.open('http://www.python.org')
File "C:\Python23\lib\webbrowser.py", line 43, in open
get().open(url, new, autoraise)
File "C:\Python23\lib\webbrowser.py", line 250, in open
os.startfile(url)
WindowsError: [Errno 2] Das System kann die angegebene Datei
nicht finden: 'http://www.python.org'

Jul 18 '05 #1
2 3219
On 6 Jul 2004 10:52:17 GMT, Matthias Huening <mh******@zedat.fu-berlin.de>
wrote:
Hi,

os.startfile('http://www.python.org') works fine on WinXP with IE as
default webbrowser. With Mozilla Firefox 0.9 as default webbrowser,
however, I get an error. Firefox starts, the page gets loaded and then
Python gives me an error message (Traceback below). The same is true
for the webbowser module. Is this a Python problem or a Firefox
problem?

Matthias

import os
os.startfile('http://www.python.org')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
os.startfile('http://www.python.org')
WindowsError: [Errno 2] Das System kann die angegebene Datei
nicht finden: 'http://www.python.org'
import webbrowser
webbrowser.open('http://www.python.org')
Traceback (most recent call last):
File "<pyshell#4>", line 1, in -toplevel-
webbrowser.open('http://www.python.org')
File "C:\Python23\lib\webbrowser.py", line 43, in open
get().open(url, new, autoraise)
File "C:\Python23\lib\webbrowser.py", line 250, in open
os.startfile(url)
WindowsError: [Errno 2] Das System kann die angegebene Datei
nicht finden: 'http://www.python.org'

I hate to say but it worked for me using Opera as my default browser
on Windows 2000 but fails with Firefox so I guess it's a Firefox thing...

FYI webbrowser just calls os.startfile on windows hence the same error
Martin
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 18 '05 #2

"Matthias Huening" <mh******@zedat.fu-berlin.de> schrieb im Newsbeitrag
news:Xn**********************************@130.133. 1.4...
| Hi,
|
| os.startfile('http://www.python.org') works fine on WinXP with IE as
| default webbrowser. With Mozilla Firefox 0.9 as default webbrowser,
| however, I get an error. Firefox starts, the page gets loaded and then
| Python gives me an error message (Traceback below). The same is true
| for the webbowser module. Is this a Python problem or a Firefox
| problem?
|
| Matthias
|
|
| >>> import os
| >>> os.startfile('http://www.python.org')
|
| Traceback (most recent call last):
| File "<pyshell#2>", line 1, in -toplevel-
| os.startfile('http://www.python.org')
| WindowsError: [Errno 2] Das System kann die angegebene Datei
| nicht finden: 'http://www.python.org'
|
| >>> import webbrowser
| >>> webbrowser.open('http://www.python.org')
|
| Traceback (most recent call last):
| File "<pyshell#4>", line 1, in -toplevel-
| webbrowser.open('http://www.python.org')
| File "C:\Python23\lib\webbrowser.py", line 43, in open
| get().open(url, new, autoraise)
| File "C:\Python23\lib\webbrowser.py", line 250, in open
| os.startfile(url)
| WindowsError: [Errno 2] Das System kann die angegebene Datei
| nicht finden: 'http://www.python.org'
| >>>
I have the same issue with FF 0.9.1 (can't really say if I had the same
problem with prior versions - maybe I didn't notice) as default browser on
XP Prof. Not only when starting a url from Python, but also from other
programs, yes: even when double clicking a *.url. FF loads the page just
fine, but the "invoking program" always returns an error message.

--
Vincent Wehren

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by SPE - Stani's Python Editor | last post: by
19 posts views Thread by Blair P. Houghton | last post: by
3 posts views Thread by BartlebyScrivener | last post: by
8 posts views Thread by Dustan | last post: by
14 posts views Thread by Ron Adam | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.