classification
Title: webbrowser regression on windows
Type: behavior Stage: test needed
Components: Library (Lib), Windows Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, ezio.melotti, georg.brandl, techtonik
Priority: normal Keywords:

Created on 2010-06-08 03:46 by techtonik, last changed 2010-06-08 06:25 by techtonik.

Messages (6)
msg107297 - (view) Author: anatoly techtonik (techtonik) Date: 2010-06-08 03:46
webbrowser.open("127.0.0.1:8080") opens page in IE even if default system browser is Chrome.
msg107299 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-06-08 03:53
See also #8232
msg107300 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-06-08 03:54
Also, since you stated that this is a regression -- what was the last version you saw this work in?
msg107301 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-06-08 03:55
If you want it to open it with the default browser you have to specify the protocol (e.g. webbrowser.open("http://127.0.0.1:8080/")).
I don't know exactly why webbrowser decides to open webbrowser.open("127.0.0.1:8080") with IE, but the behavior seems consistent in all the versions, so it's not a regression.
msg107305 - (view) Author: anatoly techtonik (techtonik) Date: 2010-06-08 05:40
2.5 threw exception
msg107306 - (view) Author: anatoly techtonik (techtonik) Date: 2010-06-08 06:25
webbrowser.open("%s:%s" % (HOST,PORT))
  File "C:\Python25\lib\webbrowser.py", line 61, in open
    if browser.open(url, new, autoraise):
  File "C:\Python25\lib\webbrowser.py", line 518, in open
    os.startfile(url)
WindowsError: [Error -2147217406] Windows Error 0x80041002: '127.0.0.1:8080'


I do not mind if new Python would handle this exception correctly, but it doesn't launching wrong browser. If I specify "http://" prefix - the Chrome launched as expected. Note that if "127.0.0.1:8080" is executed from shell (search menu or run dialog) - IE is not started by Vista.
History
Date User Action Args
2010-06-08 06:25:20techtoniksetmessages: + msg107306
2010-06-08 05:40:12techtoniksetmessages: + msg107305
2010-06-08 03:55:57ezio.melottisetnosy: + georg.brandl, ezio.melotti
messages: + msg107301
2010-06-08 03:54:25brian.curtinsetmessages: + msg107300
2010-06-08 03:53:38brian.curtinsetversions: - Python 2.6
nosy: + brian.curtin

messages: + msg107299

type: behavior
stage: test needed
2010-06-08 03:46:40techtonikcreate