[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)
jaystrict
report at bugs.python.org
Mon Oct 26 14:43:52 EDT 2015
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) = -1 EACCES (Permission denied)
AFAICT this line is generated when the shell looks for the correct python executable, but it should not interfere with the (later) call to subprocess.check_output().
If I delete "/home/user1/bin" from $PATH, then the correct FileNotFoundError is thrown.
So it seems (just guessing) that subprocess.check_output() somehow throws the older, obsolete error code. Would this be possible?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25481>
_______________________________________
More information about the Python-bugs-list
mailing list