summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-11-08 12:06:17 (GMT)
committerGitHub <noreply@github.com>2020-11-08 12:06:17 (GMT)
commitdb087f6d9ef9a7c873cd883ee120126fc0ca0c72 (patch)
tree39118e762d9d2682415a7cd7faa4ed64d1b9f5e8 /Lib
parenta7de7ffe32801f1f869734993d2ca4ba09d21dd7 (diff)
downloadcpython-db087f6d9ef9a7c873cd883ee120126fc0ca0c72.zip
cpython-db087f6d9ef9a7c873cd883ee120126fc0ca0c72.tar.gz
cpython-db087f6d9ef9a7c873cd883ee120126fc0ca0c72.tar.bz2
bpo-41754: Ignore NotADirectoryError in invocation of xdg-settings (GH-23075) (GH-23198)
It is not clear why this can happen, but several users have mentioned getting this exception on macOS. (cherry picked from commit 23831a7a90956e38b7d70304bb6afe30d37936de) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/webbrowser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index cea9130..6023c1e 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