Repository: xonsh/xonsh

Issue:
NotADirectoryError: [Errno 20] Not a directory: 'dircolors'
Running on Mac without `dircolors` installed.
```xsh
python3 -m xonsh
```
```python
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/xonsh/main.py", line 470, in main
    sys.exit(main_xonsh(args))
  File "/usr/local/lib/python3.10/site-packages/xonsh/main.py", line 511, in main_xonsh
    print_welcome_screen()
  File "/usr/local/lib/python3.10/site-packages/xonsh/xonfig.py", line 826, in print_welcome_screen
    print_color(line)
  File "/usr/local/lib/python3.10/site-packages/xonsh/tools.py", line 2055, in print_color
    xsh.shell.shell.print_color(string, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/xonsh/ptk_shell/shell.py", line 542, in print_color
    tokens = partial_color_tokenize(string)
  File "/usr/local/lib/python3.10/site-packages/xonsh/style_tools.py", line 70, in partial_color_tokenize
    styles = XSH.shell.shell.styler.styles
  File "/usr/local/lib/python3.10/site-packages/xonsh/base_shell.py", line 337, in styler
    self._styler = XonshStyle(env.get("XONSH_COLOR_STYLE"))
  File "/usr/local/lib/python3.10/site-packages/xonsh/pyghooks.py", line 372, in __init__
    self.style_name = style_name
  File "/usr/local/lib/python3.10/site-packages/xonsh/pyghooks.py", line 413, in style_name
    for file_type, xonsh_color in XSH.env.get("LS_COLORS", {}).items():
  File "/usr/local/lib/python3.10/site-packages/xonsh/environ.py", line 2234, in get
    return self[key]
  File "/usr/local/lib/python3.10/site-packages/xonsh/environ.py", line 2171, in __getitem__
    val = self._d[key] = val(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/environ.py", line 693, in default_lscolors
    lsc = LsColors.fromdircolors()
  File "/usr/local/lib/python3.10/site-packages/xonsh/environ.py", line 485, in fromdircolors
    out = subprocess.check_output(
  File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 503, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
NotADirectoryError: [Errno 20] Not a directory: 'dircolors'
Xonsh encountered an issue during launch
Failback to /bin/zsh

```

## For community
⬇️  **Please click the 👍 reaction instead of leaving a `+1` or 👍  comment**



Discussion:

Resolving patch:
diff --git a/xonsh/environ.py b/xonsh/environ.py
--- a/xonsh/environ.py
+++ b/xonsh/environ.py
@@ -485,7 +485,7 @@ def fromdircolors(cls, filename=None):
             out = subprocess.check_output(
                 cmd, env=denv, text=True, stderr=subprocess.DEVNULL
             )
-        except (subprocess.CalledProcessError, FileNotFoundError):
+        except (subprocess.CalledProcessError, FileNotFoundError, NotADirectoryError):
             return cls(cls.default_settings)
         except OSError:
             # necessary to catch OSError: [WinError 740] The requested operation requires elevation


Test patch: