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.
This commit is contained in:
parent
41761933c1
commit
23831a7a90
|
@ -550,7 +550,7 @@ def register_standard_browsers():
|
||||||
cmd = "xdg-settings get default-web-browser".split()
|
cmd = "xdg-settings get default-web-browser".split()
|
||||||
raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
|
raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
|
||||||
result = raw_result.decode().strip()
|
result = raw_result.decode().strip()
|
||||||
except (FileNotFoundError, subprocess.CalledProcessError, PermissionError) :
|
except (FileNotFoundError, subprocess.CalledProcessError, PermissionError, NotADirectoryError) :
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
global _os_preferred_browser
|
global _os_preferred_browser
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
webbrowser: Ignore *NotADirectoryError* when calling ``xdg-settings``.
|
Loading…
Reference in New Issue