[issue23945] webbrowser.open opens twice on Windows if BROWSER is set
andig2
report at bugs.python.org
Tue Apr 14 12:50:36 CEST 2015
andig2 added the comment:
Looking further in webbrowser.py, FF uses GenericBrowser:
class GenericBrowser(BaseBrowser):
"""Class for all browsers started with a command
and without remote functionality."""
...
def open(self, url, new=0, autoraise=True):
cmdline = [self.name] + [arg.replace("%s", url)
for arg in self.args]
try:
if sys.platform[:3] == 'win':
p = subprocess.Popen(cmdline)
else:
p = subprocess.Popen(cmdline, close_fds=True)
return not p.wait()
If FF is already open, Popen.wait() returns TRUE for FF but FALSE for IE. This leads to fallthrough for FF and then calling open for IE.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23945>
_______________________________________
More information about the Python-bugs-list
mailing list