jaystrict added the comment:
Narrowing it down further:
In $PATH there is a subdirectory of /home/user1.
PATH="/home/user1/bin:/usr/local/sbin:/usr/local/bin:/usr/bin"
Doing an strace on the example above shows the line
stat("/home/user1/bin/python", 0x7fff9d365bb0) = -
jaystrict added the comment:
I just found that a "chmod o+x /home/user1" fixes the problem in the sense that
now a FileNotFoundError is thrown.
So I am very certain that you can reproduce this by making your home directory
non-executable.
Could it be that python tries to access the
jaystrict added the comment:
I just tried the same thing in /home/user2 which is the home of user2 and in /.
In both directories the result is the PermissionError. So the cause is not the
CWD.
--
___
Python tracker
<http://bugs.python.
jaystrict added the comment:
user2 in fact has permissions in the CWD.
The CWD has been set to /tmp intentionally, exactly for that reason that every
user has "rwx" access there.
--
status: pending -> open
___
Python tracker
<http:/
New submission from jaystrict:
When running subprocess.check_output(['doesnotexist']) as another user, I
expect a FileNotFoundError, but a PermissionError is thrown.
How to reproduce:
[user1 tmp]$ su --login user2
Passwor