classification
Title: webbrowser.open incomplete on Windows
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.1
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brian.curtin, devplayer, joncwchao
Priority: normal Keywords:

Created on 2010-03-25 18:32 by joncwchao, last changed 2011-01-14 14:35 by devplayer.

Messages (4)
msg101725 - (view) Author: Jonathan Chao (joncwchao) Date: 2010-03-25 18:32
webbrowser.open(), webbrowser.open_new(), and webbrowser.open_new_tab() all do the exact same thing, regardless of the flags that I set. In Firefox, open('www.google.com', new=0), open_new('www.google.com'), and open_new_tab('www.google.com') all open either three new www.google.com tabs (if "Open new windows in a new tab instead" is selected in FF options) or three new www.google.com windows (if "Open new windows in a new tab instead" is not selected in FF options). In Internet Explorer, three new www.google.com tabs are created.

The issue exhibits itself the same way whether or not I have the browser open before running the script.

Environment was a Windows Vista 32-bit machine, running Python 3.1.2.

Example script reads:
import webbrowser
import time
ff = webbrowser.get('firefox')
ff.open('www.google.com', new=0)
time.sleep(3)
ff.open_new('www.google.com')
time.sleep(3)
ff.open_new_tab('www.google.com')
msg101728 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-03-25 19:26
On Windows, the WindowsDefault class gets used and it doesn't make use of anything other than the URL (no 'new' or 'autoraise'). All it does is pass the URL onto os.startfile.

It should make a better attempt at running the URL. Patches welcome, or I'll try to come up with one shortly.
msg101732 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-03-25 21:06
Minor correction: BackgroundBrowser gets used in this case, but it still lacks in the same area and causes what you are seeing.
msg126265 - (view) Author: Dev Player (devplayer) Date: 2011-01-14 14:35
Don't forget to check if the MS Internet Explorer's advanced option to open new URLS in a seperate windows effects this.  Users can have this advanced setting set differently on different computers(or even accounts). Also different browser versions call that option by different names. And I think there may even be a way to turn off tabs altogether, so check that too.
History
Date User Action Args
2011-01-14 14:35:26devplayersetnosy: + devplayer
messages: + msg126265
2010-03-25 21:06:50brian.curtinsetmessages: + msg101732
2010-03-25 19:26:42brian.curtinsettitle: webbrowser open(), open_new(), and open_new_tab() Broken Functionality -> webbrowser.open incomplete on Windows
2010-03-25 19:26:05brian.curtinsetpriority: normal

nosy: + brian.curtin
messages: + msg101728

stage: needs patch
2010-03-25 18:32:39joncwchaocreate