From: <nr...@us...> - 2008-06-26 01:16:23
|
Revision: 4779 http://jython.svn.sourceforge.net/jython/?rev=4779&view=rev Author: nriley Date: 2008-06-25 18:16:20 -0700 (Wed, 25 Jun 2008) Log Message: ----------- Return permission denied for files opened for reading. Modified Paths: -------------- branches/asm/src/org/python/core/io/FileIO.java Modified: branches/asm/src/org/python/core/io/FileIO.java =================================================================== --- branches/asm/src/org/python/core/io/FileIO.java 2008-06-26 00:12:50 UTC (rev 4778) +++ branches/asm/src/org/python/core/io/FileIO.java 2008-06-26 01:16:20 UTC (rev 4779) @@ -62,7 +62,8 @@ if (fullPath.isDirectory()) { throw Py.IOError(errno.EISDIR, "Is a directory"); } - if (rafMode.equals("rw") && !fullPath.canWrite()) { + if ( (rafMode.equals("rw") && !fullPath.canWrite()) || + fnfe.getMessage().endsWith("(Permission denied)")) { throw Py.IOError(errno.EACCES, "Permission denied: '" + name + "'"); } throw Py.IOError(errno.ENOENT, "No such file or directory: '" + name + "'"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |