Skip to content

Commit 1c9f339

Browse files
authored
gh-102690: Use Edge as fallback in webbrowser instead of IE (#102691)
1 parent 2a03ed0 commit 1c9f339

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Lib/webbrowser.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,15 @@ def register_standard_browsers():
542542
# First try to use the default Windows browser
543543
register("windows-default", WindowsDefault)
544544

545-
# Detect some common Windows browsers, fallback to IE
546-
iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
547-
"Internet Explorer\\IEXPLORE.EXE")
545+
# Detect some common Windows browsers, fallback to Microsoft Edge
546+
# location in 64-bit Windows
547+
edge64 = os.path.join(os.environ.get("PROGRAMFILES(x86)", "C:\\Program Files (x86)"),
548+
"Microsoft\\Edge\\Application\\msedge.exe")
549+
# location in 32-bit Windows
550+
edge32 = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
551+
"Microsoft\\Edge\\Application\\msedge.exe")
548552
for browser in ("firefox", "firebird", "seamonkey", "mozilla",
549-
"netscape", "opera", iexplore):
553+
"opera", edge64, edge32):
550554
if shutil.which(browser):
551555
register(browser, None, BackgroundBrowser(browser))
552556
else:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update :mod:`webbrowser` to fall back to Microsoft Edge instead of Internet Explorer.

0 commit comments

Comments
 (0)