diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index cea91308ce1..6023c1e1384 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -550,7 +550,7 @@ def register_standard_browsers(): cmd = "xdg-settings get default-web-browser".split() raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL) result = raw_result.decode().strip() - except (FileNotFoundError, subprocess.CalledProcessError, PermissionError) : + except (FileNotFoundError, subprocess.CalledProcessError, PermissionError, NotADirectoryError) : pass else: global _os_preferred_browser diff --git a/Misc/NEWS.d/next/Library/2020-11-01-15-07-20.bpo-41754.DraSZh.rst b/Misc/NEWS.d/next/Library/2020-11-01-15-07-20.bpo-41754.DraSZh.rst new file mode 100644 index 00000000000..181c2d9650a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-11-01-15-07-20.bpo-41754.DraSZh.rst @@ -0,0 +1 @@ +webbrowser: Ignore *NotADirectoryError* when calling ``xdg-settings``.