From: <pj...@us...> - 2008-10-16 06:38:54
|
Revision: 5420 http://jython.svn.sourceforge.net/jython/?rev=5420&view=rev Author: pjenvey Date: 2008-10-16 06:38:43 +0000 (Thu, 16 Oct 2008) Log Message: ----------- fix os.access not handling multiple modes, and make its X_OK work via jna-posix's stat Modified Paths: -------------- trunk/jython/Lib/os.py Modified: trunk/jython/Lib/os.py =================================================================== --- trunk/jython/Lib/os.py 2008-10-16 03:28:52 UTC (rev 5419) +++ trunk/jython/Lib/os.py 2008-10-16 06:38:43 UTC (rev 5420) @@ -421,15 +421,17 @@ raise TypeError('an integer is required') f = File(sys.getPath(path)) + result = True if not f.exists(): - return False + result = False if mode & R_OK and not f.canRead(): - return False + result = False if mode & W_OK and not f.canWrite(): - return False - if mode & X_OK: - return False - return True + result = False + if mode & X_OK and not (stat(path).st_mode & _stat.S_IEXEC): + # NOTE: always False without jna-posix stat + result = False + return result def stat(path): """stat(path) -> stat result This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |