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>
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
--- /dev/null
+webbrowser: Ignore *NotADirectoryError* when calling ``xdg-settings``.