Repository: xonsh/xonsh

Issue:
There is no candidates if no permission files in PATH
<!--- Provide a general summary of the issue in the Title above -->
<!--- If you have a question along the lines of "How do I do this Bash command in xonsh"
please first look over the Bash to Xonsh translation guide: http://xon.sh/bash_to_xsh.html
If you don't find an answer there, please do open an issue! -->

## xonfig
<!--- Please post the output of the `xonfig` command (run from inside xonsh) so we know more about your current setup -->

```
+------------------+---------------------+
| xonsh            | 0.8.3               |
| Git SHA          | 07eb341c            |
| Commit Date      | Nov 6 07:39:16 2018 |
| Python           | 3.7.1               |
| PLY              | 3.11                |
| have readline    | True                |
| prompt toolkit   | 2.0.7               |
| shell type       | prompt_toolkit2     |
| pygments         | 2.2.0               |
| on posix         | True                |
| on linux         | True                |
| distro           | unknown             |
| on darwin        | False               |
| on windows       | False               |
| on cygwin        | False               |
| on msys2         | False               |
| is superuser     | False               |
| default encoding | utf-8               |
| xonsh encoding   | utf-8               |
| encoding errors  | surrogateescape     |
+------------------+---------------------+
```

## Expected Behavior
<!--- Tell us what should happen -->

All executable files in PATH directory should appear in candidates.

## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
<!--- If part of your bug report is a traceback, please first enter debug mode before triggering the error
To enter debug mode, set the environment variable `XONSH_DEBUG=1` _before_ starting `xonsh`.  
On Linux and OSX, an easy way to to do this is to run `env XONSH_DEBUG=1 xonsh` -->

There is no candidates after PermissionError file in its path.

## Steps to Reproduce
<!--- Please try to write out a minimal reproducible snippet to trigger the bug, it will help us fix it! -->

```
$ ls /usr/local/bin

$ touch /usr/local/bin/aaa
$ chmod 700 /usr/local/bin/aaa
$ sudo chown root /usr/local/bin/aaa
```

There are no tab completion candidates in /usr/local/bin.

--

It perhaps is able to fix by adding errors to catch on [xonsh.tools:L759](https://github.com/xonsh/xonsh/blob/master/xonsh/tools.py#L757-L759).

`file_.is_file()` on L757 may raise `OSError`. Thus, L759 should catch `OSError` (or, `PermissionError` in this case).


Discussion:
Thanks for reporting! Would you be able to put in a pull request please?
Of cause!

Resolving patch:
diff --git a/xonsh/tools.py b/xonsh/tools.py
--- a/xonsh/tools.py
+++ b/xonsh/tools.py
@@ -756,7 +756,7 @@ def _yield_accessible_unix_file_names(path):
         try:
             if file_.is_file() and os.access(file_.path, os.X_OK):
                 yield file_.name
-        except (FileNotFoundError, NotADirectoryError):
+        except OSError:
             # broken Symlink are neither dir not files
             pass
 


Test patch: