Open GoogleCodeExporter opened 8 years ago
What is the output of ls -l test_something.py on the Solaris machine?
Also, do you know the Python code for checking if a file is executable on
Solaris?
Original comment by kumar.mcmillan
on 29 May 2011 at 4:21
OK something additional info I noticed:
When running nosetests test_something.py directly, it runs the tests well.
Only when running nosetests . (recursively), it skips the file.
Maybe it makes sense because only this way skipping executable works, but maybe
it isn't - just letting you know.
Now, about ls -l:
-rw-r--r-- 1 root root 7120 May 11 09:30 test_something.py
About determining if file is executable in solaris:
>>> import os
>>> import stat
>>> def is_executable(file):
... st = os.stat(file)
... return bool(st.st_mode & stat.S_IXUSR)
...
Original comment by yoni...@gmail.com
on 30 May 2011 at 6:50
This is a bug in Python and only occurs when Python is executed as root.
Original comment by adiroi...@gmail.com
on 2 May 2012 at 10:46
No. This is an OS implementation issue as using access(2) with root will always
return == 0 for R_OK/W_OK/X_OK if root is accessing a path (this is a
bug/feature I discovered after I brought up the topic here:
http://freebsd.1045724.n5.nabble.com/Chasing-down-bugs-with-access-2-td4206969.h
tml ). Only Linux consistently seems to do what one might expect by returning
non-zero for non-executable scripts.
Original comment by yaneg...@gmail.com
on 15 Oct 2012 at 8:50
Original issue reported on code.google.com by
yoni...@gmail.com
on 27 May 2011 at 7:47