From 23831a7a90956e38b7d70304bb6afe30d37936de Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Sun, 8 Nov 2020 10:46:55 +0100 Subject: bpo-41754: Ignore NotADirectoryError in invocation of xdg-settings (GH-23075) It is not clear why this can happen, but several users have mentioned getting this exception on macOS. --- Lib/webbrowser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/webbrowser.py') diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index cea91308ce..6023c1e138 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 -- cgit v1.2.1