From 2b6e2609682f2bd7d676d0fd3c53e4ad523bc4fb Mon Sep 17 00:00:00 2001 From: adam j hartz Date: Fri, 4 Dec 2015 08:12:29 -0500 Subject: [PATCH] error on trying to cd to directory without executable bit --- xonsh/dirstack.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xonsh/dirstack.py b/xonsh/dirstack.py index 6c6ab4435..b759083f9 100644 --- a/xonsh/dirstack.py +++ b/xonsh/dirstack.py @@ -88,6 +88,8 @@ def cd(args, stdin=None): return '', 'cd: no such file or directory: {0}\n'.format(d) if not os.path.isdir(d): return '', 'cd: {0} is not a directory\n'.format(d) + if not os.access(d, os.X_OK): + return '', 'cd: permission denied: {0}\n'.format(d) # now, push the directory onto the dirstack if AUTO_PUSHD is set if cwd is not None and env.get('AUTO_PUSHD'): pushd(['-n', '-q', cwd])