From c33c859d32306a5ac9bdfe771459cc3a8a914f0d Mon Sep 17 00:00:00 2001 From: james Date: Tue, 14 Mar 2023 20:42:05 +1100 Subject: [PATCH 1/7] Update webbrowser.py to use Edge as fallback instead of IE --- Lib/webbrowser.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 44974d433b4696..b5a4098c17a00c 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -542,11 +542,12 @@ def register_standard_browsers(): # First try to use the default Windows browser register("windows-default", WindowsDefault) - # Detect some common Windows browsers, fallback to IE - iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), - "Internet Explorer\\IEXPLORE.EXE") - for browser in ("firefox", "firebird", "seamonkey", "mozilla", - "netscape", "opera", iexplore): + # Detect some common Windows browsers, fallback to Edge + edge = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"), + "Microsoft\\Edge\\Application\\msedge.exe") + edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), + "Microsoft\\Edge\\Application\\msedge.exe") + for browser in ("firefox", "firebird", "seamonkey", "mozilla", "opera", edge, edge32): if shutil.which(browser): register(browser, None, BackgroundBrowser(browser)) else: From 3b4d8dde81f4b33537cef27f7e2e581f91b26e4d Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 10:52:44 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst diff --git a/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst b/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst new file mode 100644 index 00000000000000..925b30df4a74ca --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst @@ -0,0 +1 @@ +Update webbrowsers.py to fallback to Microsoft Edge instead of IE From ecc53fb2333285eaa6ddbd047669b3a1663dcfa6 Mon Sep 17 00:00:00 2001 From: Jamoo721 <81095953+Jamoo721@users.noreply.github.com> Date: Wed, 15 Mar 2023 01:38:22 +1100 Subject: [PATCH 3/7] Update Lib/webbrowser.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric --- Lib/webbrowser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index b5a4098c17a00c..55257ce7f6af7f 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -547,7 +547,8 @@ def register_standard_browsers(): "Microsoft\\Edge\\Application\\msedge.exe") edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), "Microsoft\\Edge\\Application\\msedge.exe") - for browser in ("firefox", "firebird", "seamonkey", "mozilla", "opera", edge, edge32): + for browser in ("firefox", "firebird", "seamonkey", "mozilla", + "opera", edge, edge32): if shutil.which(browser): register(browser, None, BackgroundBrowser(browser)) else: From 8a00decdef3fa46a20743c490c624b327fce938b Mon Sep 17 00:00:00 2001 From: Jamoo721 <81095953+Jamoo721@users.noreply.github.com> Date: Wed, 15 Mar 2023 01:38:56 +1100 Subject: [PATCH 4/7] Update Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric --- .../next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst b/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst index 925b30df4a74ca..5669ebbb442c24 100644 --- a/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst +++ b/Misc/NEWS.d/next/Windows/2023-03-14-10-52-43.gh-issue-102690.sbXtqk.rst @@ -1 +1 @@ -Update webbrowsers.py to fallback to Microsoft Edge instead of IE +Update :mod:`webbrowser` to fall back to Microsoft Edge instead of Internet Explorer. From 55ec1133ee751bc73384b191d3ba6ab0efc4ef4b Mon Sep 17 00:00:00 2001 From: james Date: Wed, 15 Mar 2023 17:48:30 +1100 Subject: [PATCH 5/7] Update variable names, add descriptive comments --- Lib/webbrowser.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 55257ce7f6af7f..acae6344fe016a 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -542,13 +542,15 @@ def register_standard_browsers(): # First try to use the default Windows browser register("windows-default", WindowsDefault) - # Detect some common Windows browsers, fallback to Edge - edge = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"), + # Detect some common Windows browsers, fallback to Microsoft Edge + # location in 64-bit Windows + edge64 = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"), "Microsoft\\Edge\\Application\\msedge.exe") + # location in 32-bit Windows edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), "Microsoft\\Edge\\Application\\msedge.exe") for browser in ("firefox", "firebird", "seamonkey", "mozilla", - "opera", edge, edge32): + "opera", edge64, edge32): if shutil.which(browser): register(browser, None, BackgroundBrowser(browser)) else: From 3fd510f47ed2277ba0cd5e5790c3af0d301a7ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric?= Date: Wed, 15 Mar 2023 19:51:46 -0400 Subject: [PATCH 6/7] style --- Lib/webbrowser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index acae6344fe016a..3d7e378a400e8c 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -545,7 +545,7 @@ def register_standard_browsers(): # Detect some common Windows browsers, fallback to Microsoft Edge # location in 64-bit Windows edge64 = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"), - "Microsoft\\Edge\\Application\\msedge.exe") + "Microsoft\\Edge\\Application\\msedge.exe") # location in 32-bit Windows edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), "Microsoft\\Edge\\Application\\msedge.exe") From 3c42f6dba6893d0ddacc874b7f625a2a9d29aaac Mon Sep 17 00:00:00 2001 From: Jamoo721 <81095953+Jamoo721@users.noreply.github.com> Date: Thu, 16 Mar 2023 11:01:03 +1100 Subject: [PATCH 7/7] Update Lib/webbrowser.py Co-authored-by: Steve Dower --- Lib/webbrowser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 3d7e378a400e8c..a56ff33dbbdc69 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -548,7 +548,7 @@ def register_standard_browsers(): "Microsoft\\Edge\\Application\\msedge.exe") # location in 32-bit Windows edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"), - "Microsoft\\Edge\\Application\\msedge.exe") + "Microsoft\\Edge\\Application\\msedge.exe") for browser in ("firefox", "firebird", "seamonkey", "mozilla", "opera", edge64, edge32): if shutil.which(browser):