New submission from andig2:
Setup: IE default browser, FF37 preferred browser and configured in BROWSER env
variable
Test:
import webbrowser
url = http://localhost;
webbrowser.open(url + '?XDEBUG_SESSION_START=sublime.xdebug')
Behaviour:
1st run: FF opens - ok
2nd run: FF opens new tab -
andig2 added the comment:
And finally: FF returns exit code 1 when its started and already running. That
situation is not handled by the GenericBrowser Popen logic.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23945
andig2 added the comment:
Here is a matrix of the test results depending on which browser is open upon
starting the test script:
No browser open: FF opens tab (ok)
IE open: new tab in FF (ok), nothing in IE (ok)
FF open: new tab in FF (ok), new tab in in IE (NOT ok)
Both open: new tab in FF
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 =
andig2 added the comment:
It boils down to Popen.wait() returning 1 if FF is already open resulting in
GenericBrowser.open() returning False.
That part was last touched here
https://github.com/python/cpython/commit/a456db5e058f955f235fe7a51e8c111d0a8ecf4e
--
andig2 added the comment:
Last but not least: this is due to using BROWSER for defining the executable
path.
Workaround: set BROWSER=firefox and add firefox to path.
--
resolution: - not a bug
status: open - closed
___
Python tracker