From df696752e26038ce70a13ed26df22ea37b0db8b5 Mon Sep 17 00:00:00 2001 From: james Date: Mon, 3 Apr 2023 19:47:51 +1000 Subject: [PATCH 1/2] Doscument browser fallback behaviour on Windows --- Doc/library/webbrowser.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst index 61db8042093627..bc9494f2dee980 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -62,6 +62,11 @@ The following functions are defined: (note that under many window managers this will occur regardless of the setting of this variable). + On Windows, the default browser is found via the :func:`os.startfile` function. + If no default browser is set, webbrowser searches the user's :envvar:`PATH` + for supported browsers. If no browser is found, webbrowser will fall back to + Microsoft Edge. + Note that on some platforms, trying to open a filename using this function, may work and start the operating system's associated program. However, this is neither supported nor portable. @@ -104,7 +109,7 @@ The following functions are defined: .. versionchanged:: 3.7 *preferred* keyword-only parameter was added. -A number of browser types are predefined. This table gives the type names that +A number of browser types are predefined. This table gives the type names that may be passed to the :func:`get` function and the corresponding instantiations for the controller classes, all defined in this module. From cef282305189b550a006e139cbcb450eba27922d Mon Sep 17 00:00:00 2001 From: james Date: Thu, 6 Apr 2023 00:49:44 +1000 Subject: [PATCH 2/2] Edit for clarity --- Doc/library/webbrowser.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst index bc9494f2dee980..b5d860df9e2d74 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -62,10 +62,10 @@ The following functions are defined: (note that under many window managers this will occur regardless of the setting of this variable). - On Windows, the default browser is found via the :func:`os.startfile` function. - If no default browser is set, webbrowser searches the user's :envvar:`PATH` - for supported browsers. If no browser is found, webbrowser will fall back to - Microsoft Edge. + On Windows, webbrowser displays *url* in the default browser via :func:`os.startfile`. + If no default is set, webbrowser searches for any available supported browsers + in the user's PATH environment variable. If one is found, it displays *url*. + Otherwise, webbrowser falls back to display *url* in Microsoft Edge. Note that on some platforms, trying to open a filename using this function, may work and start the operating system's associated program. However, this @@ -109,7 +109,7 @@ The following functions are defined: .. versionchanged:: 3.7 *preferred* keyword-only parameter was added. -A number of browser types are predefined. This table gives the type names that +A number of browser types are predefined. This table gives the type names that may be passed to the :func:`get` function and the corresponding instantiations for the controller classes, all defined in this module.